List of utility methods to do ConcurrentMap
Class> | getTypeFromKind(String kind) Obtain the class for the specified kind. return KIND_TO_TYPE.get(kind);
|
boolean | is(Class> clazz, Collection Checks is a class is assignable to a class in the give collection. if (clazz == null) { throw new IllegalArgumentException("clazz is null"); if (clazzes == null) { throw new IllegalArgumentException("clazzes is null"); if (cache == null) { throw new IllegalArgumentException("cache is null"); ... |
boolean | isClassClass(Class> clazz) is Class Class return is(clazz, CLASS_CLASSES, IS_CACHE_CACHE);
|
V | putIfAbsent(ConcurrentMap put If Absent V current = map.putIfAbsent(key, value);
return current != null ? current : value;
|
V | putIfAbsent(ConcurrentMap How putIfAbsent should work, returns the one value that actually ends up in the ConcurrentMap final V existingValue = map.putIfAbsent(key, value); if (existingValue == null) { return value; return existingValue; |
V | putIfAbsent(ConcurrentMap Puts a value in the specified ConcurrentMap if the key is not yet present. if (map == null) { return null; V result = map.putIfAbsent(key, value); return result != null ? result : value; |
V | putIfAbsent(ConcurrentMap put If Absent V _value = target.get(key); if (_value != null) { V _previous = target.putIfAbsent(key, _value); if (_previous != null) { _value = _previous; return _value; ... |
V | putIfAbsent(final ConcurrentMap put If Absent V exists = map.putIfAbsent(key, value); if (exists != null) { return exists; return value; |
V | putIfAbsentAndGet(ConcurrentMap If the specified key is not already associated with a value, associate it with the given value. final V old = map.putIfAbsent(key, newValue); return old != null ? old : newValue; |
boolean | remove(ConcurrentMap Removes the entry for a key only if currently mapped to a given value. return map != null && map.remove(key, value);
|