| IMapTKey, TValuePutIfAbsent Method (TKey, TValue, Int64, TimeUnit) |
Puts an entry into this map with a given ttl (time to live) value
if the specified key is not already associated with a value.
Namespace:
Hazelcast.Core
Assembly:
Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.12.3
Syntax TValue PutIfAbsent(
TKey key,
TValue value,
long ttl,
TimeUnit timeunit
)
Function PutIfAbsent (
key As TKey,
value As TValue,
ttl As Long,
timeunit As TimeUnit
) As TValue
TValue PutIfAbsent(
TKey key,
TValue value,
long long ttl,
TimeUnit timeunit
)
abstract PutIfAbsent :
key : 'TKey *
value : 'TValue *
ttl : int64 *
timeunit : TimeUnit -> 'TValue
Parameters
- key
- Type: TKey
key of the entry - value
- Type: TValue
value of the entry - ttl
- Type: SystemInt64
maximum time for this entry to stay in the map - timeunit
- Type: Hazelcast.CoreTimeUnit
TimeUnit for the timeout
Return Value
Type:
TValueold value of the entry
Remarks
Puts an entry into this map with a given ttl (time to live) value
if the specified key is not already associated with a value.
Entry will expire and get evicted after the ttl.
Warning:
This method uses
GetHashCode and
Equals of binary form of
the
key, not the actual implementations of
GetHashCode and
Equals
defined in
key's class.
Warning-2:
This method returns a clone of previous value, not the original (identically equal) value
previously put into map.
See Also