Module spring.data.redis
Interface BoundHashFieldExpirationOperations<HK>
- Type Parameters:
HK- type of the hash field names.
public interface BoundHashFieldExpirationOperations<HK>
Hash Field Expiration operations bound to a certain hash key and set of hash fields.
- Since:
- 3.5
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionSet time to live for the bound hash key/hash fields.default ExpireChanges<HK>expire(Expiration expiration) ApplyExpirationto the bound hash key/hash fields without any additional constraints.expire(Expiration expiration, ExpirationOptions options) ApplyExpirationto the bound hash key/hash fields givenexpiration options.Set the expiration for the bound hash key/hash fields as a date timestamp.Get the time to live for bound hash key/hash fields in seconds.getTimeToLive(TimeUnit timeUnit) Get the time to live for the bound hash key/hash fields and convert it to the givenTimeUnit.persist()Remove the expiration from the bound hash key/hash fields.
-
Method Details
-
expire
ApplyExpirationto the bound hash key/hash fields without any additional constraints.- Parameters:
expiration- the expiration definition.- Returns:
- changes to the hash fields. null when used in pipeline / transaction.
-
expire
ApplyExpirationto the bound hash key/hash fields givenexpiration options.- Parameters:
expiration- the expiration definition.options- expiration options.- Returns:
- changes to the hash fields. null when used in pipeline / transaction.
-
expire
Set time to live for the bound hash key/hash fields.- Parameters:
timeout- the amount of time after which the key will be expired, must not be null.- Returns:
- changes to the hash fields. null when used in pipeline / transaction.
- Throws:
IllegalArgumentException- if the timeout is null.- Since:
- 3.5
- See Also:
-
expireAt
Set the expiration for the bound hash key/hash fields as a date timestamp.- Parameters:
expireAt- must not be null.- Returns:
- changes to the hash fields. null when used in pipeline / transaction.
- Throws:
IllegalArgumentException- if the instant is null or too large to represent as aDate.- Since:
- 3.5
- See Also:
-
persist
Remove the expiration from the bound hash key/hash fields.- Returns:
- changes to the hash fields. null when used in pipeline / transaction.
- Since:
- 3.5
- See Also:
-
getTimeToLive
Get the time to live for bound hash key/hash fields in seconds.- Returns:
- the actual expirations in seconds for the hash fields. null when used in pipeline / transaction.
- Since:
- 3.5
- See Also:
-
getTimeToLive
Get the time to live for the bound hash key/hash fields and convert it to the givenTimeUnit.- Parameters:
timeUnit- must not be null.- Returns:
- the actual expirations for the hash fields in the given time unit. null when used in pipeline / transaction.
- Since:
- 3.5
- See Also:
-