Module io.github.bucket4j.core
Class EstimateAbilityToConsumeCommand
- java.lang.Object
-
- io.github.bucket4j.distributed.remote.commands.EstimateAbilityToConsumeCommand
-
- All Implemented Interfaces:
RemoteCommand<EstimationProbe>,ComparableByContent<EstimateAbilityToConsumeCommand>
public class EstimateAbilityToConsumeCommand extends Object implements RemoteCommand<EstimationProbe>, ComparableByContent<EstimateAbilityToConsumeCommand>
-
-
Field Summary
Fields Modifier and Type Field Description static SerializationHandle<EstimateAbilityToConsumeCommand>SERIALIZATION_HANDLE
-
Constructor Summary
Constructors Constructor Description EstimateAbilityToConsumeCommand(long tokensToEstimate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalsByContent(EstimateAbilityToConsumeCommand other)longestimateTokensToConsume()CommandResult<EstimationProbe>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)longgetConsumedTokens(EstimationProbe result)SerializationHandlegetSerializationHandle()longgetTokensToConsume()booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.bucket4j.distributed.remote.RemoteCommand
asVerbose, isInitializationCommand
-
-
-
-
Field Detail
-
SERIALIZATION_HANDLE
public static final SerializationHandle<EstimateAbilityToConsumeCommand> SERIALIZATION_HANDLE
-
-
Method Detail
-
execute
public CommandResult<EstimationProbe> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
- Specified by:
executein interfaceRemoteCommand<EstimationProbe>
-
getTokensToConsume
public long getTokensToConsume()
-
getSerializationHandle
public SerializationHandle getSerializationHandle()
- Specified by:
getSerializationHandlein interfaceRemoteCommand<EstimationProbe>
-
equalsByContent
public boolean equalsByContent(EstimateAbilityToConsumeCommand other)
- Specified by:
equalsByContentin interfaceComparableByContent<EstimateAbilityToConsumeCommand>
-
isImmediateSyncRequired
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)- Specified by:
isImmediateSyncRequiredin interfaceRemoteCommand<EstimationProbe>
-
estimateTokensToConsume
public long estimateTokensToConsume()
- Specified by:
estimateTokensToConsumein interfaceRemoteCommand<EstimationProbe>
-
getConsumedTokens
public long getConsumedTokens(EstimationProbe result)
- Specified by:
getConsumedTokensin interfaceRemoteCommand<EstimationProbe>
-
-