Example usage for java.lang Long MAX_VALUE

List of usage examples for java.lang Long MAX_VALUE

Introduction

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

Prototype

long MAX_VALUE

To view the source code for java.lang Long MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a long can have, 263-1.

Usage

From source file:com.redhat.lightblue.metadata.types.BigIntegerTypeTest.java

@Test
public void testCastLong() {
    assertTrue(bigIntegerType.cast(Long.MAX_VALUE) instanceof BigInteger);
}

From source file:edu.berkeley.compbio.sequtils.sequencereader.RandomSectionList.java

public long getTotalSequence() {
    return Long.MAX_VALUE;
}

From source file:info.archinnov.achilles.it.TestViewSensorByType.java

@Test
public void should_find_by_id() throws Exception {
    //Given//from w ww. ja  v a  2s.c o m
    final long id = RandomUtils.nextLong(0, Long.MAX_VALUE);
    sensorManager.crud().insert(new EntitySensor(id, 20160215L, SensorType.TEMPERATURE, 18.34d)).execute();

    //When
    final ViewSensorByType found = viewSensorManager.crud().findById(SensorType.TEMPERATURE, id, 20160215L)
            .get();

    //Then
    assertThat(found).isNotNull();
    assertThat(found.getValue()).isEqualTo(18.34d);
}

From source file:com.antsdb.saltedfish.nosql.HumpbackUtil.java

private void validate() throws Exception {
    long start = System.currentTimeMillis();
    int failures = 0;
    Humpback humpback = Humpback.open(this.home);
    for (GTable table : humpback.getTables()) {
        println("validating %s ...", table.toString());
        try {//from   ww  w. ja va2 s.  c o  m
            Boolean isIndex = null;
            RowIterator scanner = table.scan(0, Long.MAX_VALUE);
            while (scanner.next()) {
                if (isIndex == null) {
                    isIndex = isIndex(humpback, scanner.getRowPointer());
                }
                if (!isIndex) {
                    Row row = scanner.getRow();
                    for (int i = 0; i < row.getMaxColumnId(); i++) {
                        row.get(i);
                    }
                } else {
                    long pKey = scanner.getRowKeyPointer();
                    KeyBytes.create(pKey);
                }
            }
        } catch (Exception x) {
            failures++;
            x.printStackTrace();
        }
    }
    println("tables failed validation: %d", failures);
    long duration = System.currentTimeMillis() - start;
    println("duration: %s", DurationFormatUtils.formatDurationHMS(duration));
}

From source file:com.redhat.lightblue.ResponseTest.java

@Test
public void testWithModifiedCountNull() {
    builder.withModifiedCount(null);//  www. j av a 2s.  co  m
    assertFalse(new Long(Long.MAX_VALUE).equals(builder.buildResponse().getModifiedCount()));
}

From source file:com.cinnober.msgcodec.json.JsonValueHandlerTest.java

@Test
public void testUInt64EncodeMaxLong() throws IOException {
    StringWriter out = new StringWriter();
    JsonGenerator g = f.createGenerator(out);

    JsonValueHandler.UINT64.writeValue(Long.MAX_VALUE, g);
    g.flush();// w w  w.jav  a  2 s. co  m
    assertEquals("9223372036854775807", out.toString());
}

From source file:com.proofpoint.units.Duration.java

public long roundTo(TimeUnit timeUnit) {
    Preconditions.checkNotNull(timeUnit, "timeUnit is null");
    double rounded = Math.floor(getValue(timeUnit) + 0.5d);
    Preconditions.checkArgument(rounded <= Long.MAX_VALUE,
            "size is too large to be represented in requested unit as a long");
    return (long) rounded;
}

From source file:azkaban.trigger.Condition.java

private void updateNextCheckTime() {
    long time = Long.MAX_VALUE;
    for (ConditionChecker checker : checkers.values()) {
        time = Math.min(time, checker.getNextCheckTime());
    }//from   w w w.j a v a  2s.  co m
    this.nextCheckTime = time;
}

From source file:com.smartitengineering.event.hub.spi.hbase.persistents.ChannelAdapterHelper.java

@Override
protected Channel convertFromT2F(PersistentChannel toBean) {
    final ChannelBuilder builder = APIFactory.getChannelBuilder(toBean.getName())
            .description(toBean.getDescription()).authToken(toBean.getAuthToken())
            .autoExpiryDateTime(toBean.getAutoExpiryDateTime()).creationDateTime(toBean.getCreationDateTime())
            .lastModifiedDate(toBean.getLastModifiedDateTime());
    int pos = -1;
    if (logger.isDebugEnabled()) {
        logger.debug("Channel ID " + toBean.getId());
    }/*from  w  w w .j a  v a  2 s .  com*/
    if (toBean.getId() != null) {
        pos = NumberUtils.toInt(new Long(Long.MAX_VALUE - toBean.getId().longValue()).toString());
    }
    builder.position(pos);
    if (StringUtils.isNotBlank(toBean.getFilterType())) {
        builder.filter(
                APIFactory.getFilter(SupportedMimeType.valueOf(toBean.getFilterType()), toBean.getScript()));
    }
    return builder.build();
}

From source file:com.wisemapping.rest.AdminController.java

@ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = { "application/json",
        "application/xml" })
@ResponseBody//from   ww w  .j ava 2 s  . co m
public RestUser getUserById(
        @PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1,"
                + Long.MAX_VALUE + "]") long id)
        throws IOException {
    final User userBy = userService.getUserBy(id);
    if (userBy == null) {
        throw new IllegalArgumentException("User could not be found");
    }
    return new RestUser(userBy);
}