![](../icons/Hazelcast-IMDG-Logo-Orange_Dark_200px.jpg) | IMapTKey, TValueSet Method (TKey, TValue, Int64, TimeUnit) |
Puts an entry into this map with a given ttl (time to live) value.
Namespace:
Hazelcast.Core
Assembly:
Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.9.4
Syntaxvoid Set(
TKey key,
TValue value,
long ttl,
TimeUnit timeunit
)
Sub Set (
key As TKey,
value As TValue,
ttl As Long,
timeunit As TimeUnit
)
void Set(
TKey key,
TValue value,
long long ttl,
TimeUnit timeunit
)
abstract Set :
key : 'TKey *
value : 'TValue *
ttl : int64 *
timeunit : TimeUnit -> unit
Parameters
- key
- Type: TKey
key of the entry - value
- Type: TValue
value of the entry - ttl
- Type: SystemInt64
maximum time to wait for acquiring the lock for the key - timeunit
- Type: Hazelcast.CoreTimeUnit
TimeUnit for the ttl
Remarks
Puts an entry into this map with a given ttl (time to live) value.
Similar to put operation except that set
doesn't return the old value which is more efficient.
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.
See Also