org.mapdb / MapExtra / putIfAbsentBoolean


abstract fun putIfAbsentBoolean(key: K?, value: V?): Boolean

Atomically associates the specified key with the given value if it is not already associated with a value.

This is equivalent to: if(cache.containsKey(key)){}cache.put(key,value);return true;}else{return false;} * except that the action is performed atomically.


key - key with which the specified value is to be associated

value - value to be associated with the specified key


NullPointerException - if key is null or value is null

IllegalStateException - if the cache is .isClosed

ClassCastException - if the implementation is configured to perform runtime-type-checking, and the key or value types are incompatible with those that have been configured with different serialziers TODO link to JCache standard TODO credits for javadoc

true if a value was set.