Class TimingWithResult<R>

java.lang.Object
dk.cloudcreate.essentials.shared.time.Timing
dk.cloudcreate.essentials.shared.time.TimingWithResult<R>
Type Parameters:
R - the type of result

public final class TimingWithResult<R> extends Timing
  • Field Details

    • result

      public final R result
      The result of the operation performed
  • Constructor Details

    • TimingWithResult

      public TimingWithResult(R result, String description, Duration duration)
      Create a new TimingWithResult
      Parameters:
      result - The result of the operation performed
      description - Description of the timing - typically a description of what was timed/measured
      duration - How long did the operation performed take
    • TimingWithResult

      public TimingWithResult(R result, Duration duration)
      Create a new TimingWithResult
      Parameters:
      result - The result of the operation performed
      duration - How long did the operation performed take
  • Method Details

    • of

      public static <R> TimingWithResult<R> of(R result, String description, Duration duration)
      Create a new TimingWithResult
      Type Parameters:
      R - the type of result
      Parameters:
      result - The result of the operation performed
      description - Description of the timing - typically a description of what was timed/measured
      duration - How long did the operation performed take
      Returns:
      the TimingWithResult
    • of

      public static <R> TimingWithResult<R> of(R result, Duration duration)
      Create a new TimingWithResult
      Type Parameters:
      R - the type of result
      Parameters:
      result - The result of the operation performed
      duration - How long did the operation performed take
      Returns:
      the TimingWithResult
    • getResult

      public R getResult()
      The result of the operation performed
      Returns:
      The result of the operation performed
    • toString

      public String toString()
      Overrides:
      toString in class Timing