Java Utililty Methods AtomicInteger

List of utility methods to do AtomicInteger

Description

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

Method

intgetPortOffset()
The port offset is the range of ports that should not be used to find an open server port.
return 1024 + PORT_OFFSET.get();
StringgetPrefix(final String namespace, final Map namespacesPrefixesMap)
get Prefix
if (!namespacesPrefixesMap.containsKey(namespace)) {
    namespacesPrefixesMap.put(namespace, NAMESPACE_PREFIX_BASE + counter.incrementAndGet());
return namespacesPrefixesMap.get(namespace);
StringgetPrefixedTerm(String namespace, String localName)
get Prefixed Term
String prefix = nsMap.get(namespace);
if (prefix == null) {
    prefix = "ns" + counter.getAndIncrement();
    nsMap.put(namespace, prefix);
return String.format("%s:%s", prefix, localName);
MapgetQueryCounters()
get Query Counters
return queryCounters;
intgetRandom()
get Random
return serial.getAndIncrement();
StringgetRandomTenantId()
get Random Tenant Id
return "T" + TENANT_PREFIX + TENANT_ID_COUNTER.incrementAndGet();
intgetReply()
get Reply
if (replyNO.get() < 10000000) {
    return replyNO.getAndIncrement();
} else {
    replyNO.set(0);
    return replyNO.getAndIncrement();
StringgetSerialNum()
get Serial Num
int num = genrator.getAndIncrement();
num = Math.abs(num % 100);
return String.format("%02d", num);
StringgetTempFileName()
Method (3)
StringBuilder res = new StringBuilder(12);
res.append(seqStart);
res.append(fromDecimal(ai.getAndIncrement()));
return res.toString();
intgetThreadDumpId()
get Thread Dump Id
Integer id = threadDumpId.get();
if (id == null) {
    id = dumpId.incrementAndGet();
    threadDumpId.set(id);
return id;