org.mapdb / MapExtra / putIfAbsentBoolean

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.



Parameters

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

value - value to be associated with the specified key

Exceptions

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

Return
true if a value was set.