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