Code example for AtomicInteger

Methods: decrementAndGetget

0
        return tp.incrementAndGet();
    } 
     
    public int decrAndGet(String key) {
        AtomicInteger tp = map.get(key);
        if (tp.get() == 0) {
            throw new IllegalArgumentException("Key not exists: " + key);
        } 
        return tp.decrementAndGet();
    } 
     
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE