Module io.github.bucket4j.core
Class RemoteVerboseResult<T>
- java.lang.Object
-
- io.github.bucket4j.distributed.remote.RemoteVerboseResult<T>
-
- All Implemented Interfaces:
ComparableByContent<RemoteVerboseResult<?>>
public class RemoteVerboseResult<T> extends Object implements ComparableByContent<RemoteVerboseResult<?>>
Intention of this class is to provide wrapper around results returned by any method ofVerboseBucketandAsyncVerboseBucket.
-
-
Field Summary
Fields Modifier and Type Field Description static SerializationHandle<RemoteVerboseResult<?>>SERIALIZATION_HANDLE
-
Constructor Summary
Constructors Constructor Description RemoteVerboseResult(long operationTimeNanos, int resultTypeId, T value, RemoteBucketState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerboseResult<T>asLocal()booleanequalsByContent(RemoteVerboseResult<?> other)longgetOperationTimeNanos()RemoteBucketStategetState()TgetValue()<R> RemoteVerboseResult<R>map(Function<T,R> mapper)
-
-
-
Field Detail
-
SERIALIZATION_HANDLE
public static final SerializationHandle<RemoteVerboseResult<?>> SERIALIZATION_HANDLE
-
-
Constructor Detail
-
RemoteVerboseResult
public RemoteVerboseResult(long operationTimeNanos, int resultTypeId, T value, RemoteBucketState state)
-
-
Method Detail
-
getValue
public T getValue()
- Returns:
- result of operation with bucket
-
getState
public RemoteBucketState getState()
- Returns:
- snapshot of internal bucket state which was actual at operation time
-
getOperationTimeNanos
public long getOperationTimeNanos()
- Returns:
- time which was used by the bucket at the moment of handling a request
-
asLocal
public VerboseResult<T> asLocal()
-
map
public <R> RemoteVerboseResult<R> map(Function<T,R> mapper)
-
equalsByContent
public boolean equalsByContent(RemoteVerboseResult<?> other)
- Specified by:
equalsByContentin interfaceComparableByContent<T>
-
-