Class VerboseResult<T>

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 of VerboseBucket and AsyncVerboseBucket.
  • Constructor Details

    • VerboseResult

      public VerboseResult(long operationTimeNanos, T value, BucketState state)
  • Method Details

    • 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)
    • withValue

      public <R> VerboseResult<R> withValue(R newValue)
    • equalsByContent

      public boolean equalsByContent(VerboseResult<?> other)
      Specified by:
      equalsByContent in interface ComparableByContent<T>