- java.lang.Object
-
- io.github.bucket4j.VerboseResult<T>
-
- All Implemented Interfaces:
ComparableByContent<VerboseResult<?>>
public class VerboseResult<T> extends Object implements ComparableByContent<VerboseResult<?>>
Intention of this class is to provide wrapper around results returned by any method ofVerboseBucketandAsyncVerboseBucket.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceVerboseResult.DiagnosticsDescriber of internal bucket state
-
Constructor Summary
Constructors Constructor Description VerboseResult(long operationTimeNanos, T value, BucketState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalsByContent(VerboseResult<?> other)BucketConfigurationgetConfiguration()VerboseResult.DiagnosticsgetDiagnostics()longgetOperationTimeNanos()BucketStategetState()TgetValue()<R> VerboseResult<R>map(Function<T,R> mapper)
-
-
-
Constructor Detail
-
VerboseResult
public VerboseResult(long operationTimeNanos, T value, BucketState state)
-
-
Method Detail
-
getValue
public T getValue()
- Returns:
- result of operation with bucket
-
getConfiguration
public BucketConfiguration getConfiguration()
- Returns:
- snapshot of configuration which was actual at operation time
-
getState
public BucketState 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
-
getDiagnostics
public VerboseResult.Diagnostics getDiagnostics()
- Returns:
- internal state describer
-
map
public <R> VerboseResult<R> map(Function<T,R> mapper)
-
equalsByContent
public boolean equalsByContent(VerboseResult<?> other)
- Specified by:
equalsByContentin interfaceComparableByContent<T>
-
-