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:jp.primecloud.auto.api.ApiValidate.java

public static void validatePlatformNo(String platformNo) {
    ValidateUtil.required(platformNo, "EAPI-000001", new Object[] { PARAM_NAME_PLATFORM_NO });
    ValidateUtil.longInRange(platformNo, 1, Long.MAX_VALUE, "EAPI-000002",
            new Object[] { PARAM_NAME_PLATFORM_NO, 1, Long.MAX_VALUE });
}

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

@Test
public void should_dsl_update() throws Exception {
    //Given/*from  w w w  .j  av a  2s  . c  o  m*/
    final long id = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    final long incr = RandomUtils.nextLong(0L, Long.MAX_VALUE);

    //When
    manager.dsl().update().fromBaseTable().count_Incr(incr).where().id_Eq(id).execute();

    //Then
    final Row actual = session.execute("SELECT count FROM entity_counter WHERE id = " + id).one();

    assertThat(actual).isNotNull();
    assertThat(actual.getLong("count")).isEqualTo(incr);
}

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

@Test
public void should_query_using_collection_index_fromJSON() throws Exception {
    //Given/*from   w  w  w.  java  2  s .c o  m*/
    final Long id = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    scriptExecutor.executeScriptTemplate("EntityWithIndicesForJSON/insertRows.cql", ImmutableMap.of("id", id));

    //When
    final List<EntityWithIndicesForJSON> actual = manager.indexed().select().allColumns_FromBaseTable().where()
            .collectionIndex().Contains_FromJson("\"4\"").getList();

    //Then
    assertThat(actual).hasSize(1);
    final EntityWithIndicesForJSON entity = actual.get(0);
    assertThat(entity.getSimpleIndex()).isEqualTo("411");
}

From source file:eu.europa.esig.dss.validation.policy.EtsiValidationPolicy.java

@Override
public Long getMaxRevocationFreshness() {

    if (maxRevocationFreshness == null) {

        maxRevocationFreshness = Long.MAX_VALUE;

        final XmlDom revocationFreshness = getElement("/ConstraintsParameters/Revocation/RevocationFreshness");
        if (revocationFreshness != null) {

            maxRevocationFreshnessString = getLongValue(
                    "/ConstraintsParameters/Revocation/RevocationFreshness/text()");
            maxRevocationFreshnessUnit = getValue(
                    "/ConstraintsParameters/Revocation/RevocationFreshness/@Unit");
            maxRevocationFreshness = RuleUtils.convertDuration(maxRevocationFreshnessUnit, "MILLISECONDS",
                    maxRevocationFreshnessString);
            if (maxRevocationFreshness == 0) {

                maxRevocationFreshness = Long.MAX_VALUE;
            }//from  w  w  w .  j a  v a  2s  .c  o  m
        }
    }
    return maxRevocationFreshness;
}

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

@Test
public void testCastGoodString() {
    assertTrue(integerType.cast(String.valueOf(Long.MAX_VALUE)) instanceof Long);
}

From source file:org.basinmc.maven.plugins.minecraft.launcher.DownloadDescriptor.java

/**
 * Fetches the artifact from the server and stores it in a specified file.
 *//* ww  w.  ja va  2s.c o m*/
public void fetch(@Nonnull Path outputFile) throws IOException {
    HttpClient client = HttpClients.createMinimal();

    try {
        HttpGet request = new HttpGet(this.url.toURI());
        HttpResponse response = client.execute(request);

        StatusLine line = response.getStatusLine();

        if (line.getStatusCode() != 200) {
            throw new IOException(
                    "Unexpected status code: " + line.getStatusCode() + " - " + line.getReasonPhrase());
        }

        try (InputStream inputStream = response.getEntity().getContent()) {
            try (FileChannel fileChannel = FileChannel.open(outputFile, StandardOpenOption.CREATE,
                    StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) {
                try (ReadableByteChannel inputChannel = Channels.newChannel(inputStream)) {
                    fileChannel.transferFrom(inputChannel, 0, Long.MAX_VALUE);
                }
            }
        }
    } catch (URISyntaxException ex) {
        throw new IOException("Received invalid URI from API: " + ex.getMessage(), ex);
    }
}

From source file:com.joyent.manta.client.crypto.AesGcmCipherDetails.java

/**
 * Calculates the size of the plaintext data based on the ciphertext
 * size./*from w  w w.ja v  a  2 s  . c o  m*/
 *
 * @param ciphertextSize size of the ciphertext input
 * @return size of the plaintext output
 */
@Override
public long plaintextSize(final long ciphertextSize) {
    Validate.inclusiveBetween(0L, Long.MAX_VALUE, ciphertextSize);
    return ciphertextSize - getAuthenticationTagOrHmacLengthInBytes();
}

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

@Test
public void should_dsl_select_slice_async() throws Exception {
    //Given//  w ww.  j a  va  2 s . c om
    final Map<String, Object> values = new HashMap<>();
    final long id = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    values.put("id", id);
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
    dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    final Date date1 = dateFormat.parse("2015-10-01 00:00:00 GMT");
    final Date date9 = dateFormat.parse("2015-10-09 00:00:00 GMT");
    values.put("date1", "'2015-10-01 00:00:00+0000'");
    values.put("date2", "'2015-10-02 00:00:00+0000'");
    values.put("date3", "'2015-10-03 00:00:00+0000'");
    values.put("date4", "'2015-10-04 00:00:00+0000'");
    values.put("date5", "'2015-10-05 00:00:00+0000'");
    values.put("date6", "'2015-10-06 00:00:00+0000'");
    values.put("date7", "'2015-10-07 00:00:00+0000'");
    values.put("date8", "'2015-10-08 00:00:00+0000'");
    values.put("date9", "'2015-10-09 00:00:00+0000'");
    scriptExecutor.executeScriptTemplate("SimpleEntity/insert_many_rows.cql", values);

    final CountDownLatch latch = new CountDownLatch(1);
    final CassandraLogAsserter logAsserter = new CassandraLogAsserter();
    logAsserter.prepareLogLevel(ASYNC_LOGGER_STRING, "%msg - [%thread]%n");

    //When
    final CompletableFuture<List<SimpleEntity>> future = manager.dsl().select().consistencyList().simpleSet()
            .simpleMap().value().simpleMap().fromBaseTable().where().id_Eq(id).date_Gte_And_Lt(date1, date9)
            .withResultSetAsyncListener(rs -> {
                LOGGER.info(CALLED);
                latch.countDown();
                return rs;
            }).withTracing().getListAsync();

    //Then
    latch.await();
    assertThat(future.get()).hasSize(8);
    logAsserter.assertContains("Called - [achilles-default-executor");
}

From source file:com.twitter.hraven.etl.JobFileModifiedRangeSubstringPathFilter.java

/**
 * Constructs a filter that accepts only JobFiles with lastModification time
 * as least the specified minumum./*from  w  w  w  .  ja v a 2  s.c o  m*/
 * 
 * @param myConf
 *          used to be able to go from a path to a FileStatus.
 * @param minModificationTimeMillis
 *          The minimum modification time of a file to be accepted in
 *          milliseconds since January 1, 1970 UTC (excluding).
 */
public JobFileModifiedRangeSubstringPathFilter(Configuration myConf, long minModificationTimeMillis) {
    this(myConf, minModificationTimeMillis, Long.MAX_VALUE);
}

From source file:info.archinnov.achilles.test.integration.tests.bugs.JSONSerializationForCollectionAndMapIT.java

@Test
public void should_decode() throws Exception {
    //Given//from   w  ww. j av  a 2s. co  m
    Long id = RandomUtils.nextLong(0, Long.MAX_VALUE);

    final Insert insert = insertInto(EntityWithJSONOnCollectionAndMap.TABLE_NAME).value("id", id)
            .value("mylist", Arrays.asList("1", "2")).value("myset", Sets.newHashSet("3"))
            .value("keymap", ImmutableMap.of("1", 100)).value("valuemap", ImmutableMap.of(2, "200"))
            .value("keyvaluemap", ImmutableMap.of("3", "300"));

    manager.nativeQuery(insert).execute();

    //When
    final EntityWithJSONOnCollectionAndMap found = manager.find(EntityWithJSONOnCollectionAndMap.class, id);

    //Then
    assertThat(found.getMyList()).containsExactly(1, 2);
    assertThat(found.getMySet()).containsExactly(3);
    assertThat(found.getKeyMap()).contains(MapEntry.entry(1, 100));
    assertThat(found.getValueMap()).contains(MapEntry.entry(2, 200));
    assertThat(found.getKeyValueMap()).contains(MapEntry.entry(3, 300));
}