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

  • Constructor Details

    • RemoteVerboseResult

      public RemoteVerboseResult(long operationTimeNanos, int resultTypeId, T value, RemoteBucketState state)
  • Method Details

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

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

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