Example usage for java.lang Long longValue

List of usage examples for java.lang Long longValue

Introduction

In this page you can find the example usage for java.lang Long longValue.

Prototype

@HotSpotIntrinsicCandidate
public long longValue() 

Source Link

Document

Returns the value of this Long as a long value.

Usage

From source file:com.hendisantika.pasien.dao.AlamatDaoTest.java

@Test
public void testHitung() {
    Long jumlah = ar.count();
    Assert.assertEquals(8L, jumlah.longValue());
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.LongCalculator.java

public Object add(Object obj1, Object obj2) {
    Long longData1 = (Long) obj1;
    Long longData2 = (Long) obj2;

    return (Object) (new Long((long) (longData1.longValue() + longData2.longValue())));
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.LongCalculator.java

public Object div(Object obj1, Object obj2) {
    Long longData1 = (Long) obj1;
    Long longData2 = (Long) obj2;

    return (Object) (new Long((long) (longData1.longValue() / longData2.longValue())));
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.LongCalculator.java

public Object mul(Object obj1, Object obj2) {
    Long longData1 = (Long) obj1;
    Long longData2 = (Long) obj2;

    return (Object) (new Long((long) (longData1.longValue() * longData2.longValue())));
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.LongCalculator.java

public Object sub(Object obj1, Object obj2) {
    Long longData1 = (Long) obj1;
    Long longData2 = (Long) obj2;

    return (Object) (new Long((long) (longData1.longValue() - longData2.longValue())));
}

From source file:gallery.web.controller.resolution.Validation.java

public void validateCMS(Object target, Errors errors) {
    Resolution p = (Resolution) target;//  w ww .  ja  va 2s .c om
    if (p.getHeight() != null && p.getHeight().intValue() < 1) {
        errors.rejectValue("height", "typeMismatch.sort");
    }
    if (p.getWidth() != null && p.getWidth().intValue() < 1) {
        errors.rejectValue("width", "typeMismatch.sort");
    }
    //checks if such resolution is allready in database
    if (!errors.hasErrors()) {
        Long c = service.getRowCount(PROPERTY_NAMES, new Object[] { p.getWidth(), p.getHeight() });
        if (c.longValue() > 0) {
            errors.reject("resolution.duplicate");
        }
    }
}

From source file:org.focusns.common.web.page.engine.widget.TimeoutWidgetCache.java

@Override
public Object get(WidgetConfig widgetConfig) {
    Long timestamp = timestampMap.get(widgetConfig.getId());
    if (timestamp == null
            || (timestamp.longValue() + widgetConfig.getCache() * 1000) < System.currentTimeMillis()) {
        return null;
    }//from w  w w.j a  va 2 s.  com
    Cache.ValueWrapper valueWrapper = cache.get(widgetConfig.getId());
    return valueWrapper == null ? null : valueWrapper.get();
}

From source file:com.budiana.irpan.belajar.dao.PesertaDaoTest.java

@Test
public void testInsert() throws SQLException {
    Peserta p = new Peserta();
    p.setNama("Peserta 01");
    p.setEmail("peserta01@gmail.com");
    p.setTanggalLahir(new Date());

    pd.save(p);//  w w w  .j a va2 s  .  c  o m
    String sql = "select count(*) as jumlah from peserta where email = 'peserta01@gmail.com'";
    try (Connection c = ds.getConnection()) {
        ResultSet rs = c.createStatement().executeQuery(sql);
        Assert.assertTrue(rs.next());

        Long jumlahRow = rs.getLong("jumlah");
        Assert.assertEquals(1L, jumlahRow.longValue());
        c.close();
    }
}

From source file:io.github.microcks.repository.TestResultRepositoryTest.java

@Test
public void testFindLastOnesForService() {
    List<TestResult> older = repository.findByServiceId(serviceId,
            new PageRequest(0, 2, Sort.Direction.DESC, "testNumber"));
    assertEquals(2, older.size());//  w  w w .j  a va  2  s .c  o  m
    Long newTestNumber = older.get(0).getTestNumber() + 1L;
    assertEquals(3L, newTestNumber.longValue());
}

From source file:com.mobileman.projecth.business.security.DecoderServiceTest.java

/**
 * /*ww w  .j av a2 s  . c  o  m*/
 * @throws Exception
 */
@Test
public void decodeLong() throws Exception {

    assertNull(decoderService.decodeLong(null));

    Long result = decoderService.decodeLong("w2gNG97Ppv1UhM3an6+KQA==");
    assertEquals(100, result.longValue());
}