Java Utililty Methods AtomicLong Accumulator

List of utility methods to do AtomicLong Accumulator

Description

The list of methods to do AtomicLong Accumulator are organized into topic(s).

Method

voidaddInlineCollectionToSqlString(StringBuilder sql, Collection values)
add Inline Collection To Sql String
if (values != null && !values.isEmpty()) {
    for (Object t : values) {
        sql.append(toSanitizedString(t));
        sql.append(",");
    sql.deleteCharAt(sql.length() - 1);
intcalculateMemory()
calculate Memory
long heapSize = Runtime.getRuntime().totalMemory();
long heapMaxSize = Runtime.getRuntime().maxMemory();
if (heapSize < heapMaxSize) {
    return Integer.MAX_VALUE;
long heapFreeSize = Runtime.getRuntime().freeMemory();
int size = (int) ((heapFreeSize * 100) / heapMaxSize);
if (size > (100 - 95)) {
...
StringgetDefaultSSLProtocol()
Retrieves the SSL protocol string that will be used by calls to #createSSLContext() that do not explicitly specify which protocol to use.
return DEFAULT_SSL_PROTOCOL.get();
SetgetEnabledSSLProtocols()
Retrieves the set of SSL protocols that will be enabled for use, if available, for SSL sockets created within the LDAP SDK.
return ENABLED_SSL_PROTOCOLS.get();
LongAddergetIncrement()
get Increment
LongAdder adder = increment.get();
if (adder == null) {
    adder = new LongAdder();
    increment.set(adder);
return adder;
Longmin(List list)
min
Objects.requireNonNull(list, "list is null");
if (list.isEmpty()) {
    throw new IllegalArgumentException("list is empty");
LongAccumulator la = new LongAccumulator((left, right) -> {
    return left > right ? right : left;
}, Long.MAX_VALUE);
list.parallelStream().forEach(e -> la.accumulate(e));
...
ThreadLocalRandomrandom()
Gets the ThreadLocalRandom instance for the current thread.
return ThreadLocalRandom.current();
voidsetEnabledSSLProtocols(final Collection enabledSSLProtocols)
Specifies the set of SSL protocols that will be enabled for use for SSL sockets created within the LDAP SDK.
if (enabledSSLProtocols == null) {
    ENABLED_SSL_PROTOCOLS.set(Collections.<String>emptySet());
} else {
    ENABLED_SSL_PROTOCOLS.set(Collections.unmodifiableSet(new HashSet<>(enabledSSLProtocols)));
voidsignalAll(AtomicBoolean condition)
signal All
synchronized (condition) {
    condition.set(true);
    condition.notifyAll();
booleanwaitForCondition(final AtomicBoolean condition, long timeout)
wait For Condition
try {
    return waitForConditionEx(condition, timeout);
} catch (InterruptedException e) {
    throw new RuntimeException("Error: unexpected exception caught!", e);