List of utility methods to do AtomicLong Accumulator
void | addInlineCollectionToSqlString(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); |
int | calculateMemory() 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)) { ... |
String | getDefaultSSLProtocol() 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();
|
Set | getEnabledSSLProtocols() 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();
|
LongAdder | getIncrement() get Increment LongAdder adder = increment.get(); if (adder == null) { adder = new LongAdder(); increment.set(adder); return adder; |
Long | min(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)); ... |
ThreadLocalRandom | random() Gets the ThreadLocalRandom instance for the current thread. return ThreadLocalRandom.current();
|
void | setEnabledSSLProtocols(final Collection 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))); |
void | signalAll(AtomicBoolean condition) signal All synchronized (condition) {
condition.set(true);
condition.notifyAll();
|
boolean | waitForCondition(final AtomicBoolean condition, long timeout) wait For Condition try { return waitForConditionEx(condition, timeout); } catch (InterruptedException e) { throw new RuntimeException("Error: unexpected exception caught!", e); |