Module io.github.bucket4j.core
Class FixedTtlExpirationAfterWriteStrategy
java.lang.Object
io.github.bucket4j.distributed.expiration.FixedTtlExpirationAfterWriteStrategy
- All Implemented Interfaces:
ExpirationAfterWriteStrategy,ComparableByContent<FixedTtlExpirationAfterWriteStrategy>
public class FixedTtlExpirationAfterWriteStrategy
extends Object
implements ExpirationAfterWriteStrategy, ComparableByContent<FixedTtlExpirationAfterWriteStrategy>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SerializationHandle<FixedTtlExpirationAfterWriteStrategy> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcalculateTimeToLiveMillis(RemoteBucketState state, long currentTimeNanos) Calculates the time to live for bucket that is going to be persisted to the remote storageboolean
-
Field Details
-
SERIALIZATION_HANDLE
-
-
Constructor Details
-
FixedTtlExpirationAfterWriteStrategy
-
-
Method Details
-
calculateTimeToLiveMillis
Description copied from interface:ExpirationAfterWriteStrategyCalculates the time to live for bucket that is going to be persisted to the remote storage- Specified by:
calculateTimeToLiveMillisin interfaceExpirationAfterWriteStrategy- Parameters:
state- the state of bucket that is going to be persisted to the remote storagecurrentTimeNanos- the time of operation- Returns:
- time to live for bucket in milliseconds, negative value must be considered that bucket should be stored forever without expiration
-
getSerializationHandle
- Specified by:
getSerializationHandlein interfaceExpirationAfterWriteStrategy
-
equalsByContent
- Specified by:
equalsByContentin interfaceComparableByContent<FixedTtlExpirationAfterWriteStrategy>
-