io.infinicast.ConcurrentHashmapExtensions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinicast-client-jdk8 Show documentation
Show all versions of infinicast-client-jdk8 Show documentation
Infinicast SDK to communicate with the cloud.
package io.infinicast;
import java.util.concurrent.ConcurrentHashMap;
public class ConcurrentHashmapExtensions {
public static V getOrAdd(ConcurrentHashMap map,K key, V value) {
V result = map.putIfAbsent(key, value);
return null == result ? value : result;
}
}