Module io.github.bucket4j.core
Class AddTokensCommand
- java.lang.Object
-
- io.github.bucket4j.distributed.remote.commands.AddTokensCommand
-
- All Implemented Interfaces:
RemoteCommand<Nothing>,ComparableByContent<AddTokensCommand>
public class AddTokensCommand extends Object implements RemoteCommand<Nothing>, ComparableByContent<AddTokensCommand>
-
-
Field Summary
Fields Modifier and Type Field Description static SerializationHandle<AddTokensCommand>SERIALIZATION_HANDLE
-
Constructor Summary
Constructors Constructor Description AddTokensCommand(long tokensToAdd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalsByContent(AddTokensCommand other)longestimateTokensToConsume()CommandResult<Nothing>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)longgetConsumedTokens(Nothing result)SerializationHandlegetSerializationHandle()longgetTokensToAdd()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<AddTokensCommand> SERIALIZATION_HANDLE
-
-
Method Detail
-
execute
public CommandResult<Nothing> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
- Specified by:
executein interfaceRemoteCommand<Nothing>
-
getTokensToAdd
public long getTokensToAdd()
-
getSerializationHandle
public SerializationHandle getSerializationHandle()
- Specified by:
getSerializationHandlein interfaceRemoteCommand<Nothing>
-
equalsByContent
public boolean equalsByContent(AddTokensCommand other)
- Specified by:
equalsByContentin interfaceComparableByContent<AddTokensCommand>
-
isImmediateSyncRequired
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)- Specified by:
isImmediateSyncRequiredin interfaceRemoteCommand<Nothing>
-
estimateTokensToConsume
public long estimateTokensToConsume()
- Specified by:
estimateTokensToConsumein interfaceRemoteCommand<Nothing>
-
getConsumedTokens
public long getConsumedTokens(Nothing result)
- Specified by:
getConsumedTokensin interfaceRemoteCommand<Nothing>
-
-