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 class TimingWithResult<R> extends Timing
The result ofStopWatch.time(Supplier)
-
-
Field Summary
Fields Modifier and Type Field Description RresultThe result of the operation performed-
Fields inherited from class dk.cloudcreate.essentials.shared.time.Timing
description, duration
-
-
Constructor Summary
Constructors Constructor Description TimingWithResult(R result, String description, Duration duration)Create a newTimingWithResultTimingWithResult(R result, Duration duration)Create a newTimingWithResult
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RgetResult()The result of the operation performedstatic <R> TimingWithResult<R>of(R result, String description, Duration duration)Create a newTimingWithResultstatic <R> TimingWithResult<R>of(R result, Duration duration)Create a newTimingWithResultStringtoString()-
Methods inherited from class dk.cloudcreate.essentials.shared.time.Timing
getDescription, getDuration, of, of
-
-
-
-
Field Detail
-
result
public final R result
The result of the operation performed
-
-
Constructor Detail
-
TimingWithResult
public TimingWithResult(R result, String description, Duration duration)
Create a newTimingWithResult- Parameters:
result- The result of the operation performeddescription- Description of the timing - typically a description of what was timed/measuredduration- How long did the operation performed take
-
TimingWithResult
public TimingWithResult(R result, Duration duration)
Create a newTimingWithResult- Parameters:
result- The result of the operation performedduration- How long did the operation performed take
-
-
Method Detail
-
of
public static <R> TimingWithResult<R> of(R result, String description, Duration duration)
Create a newTimingWithResult- Type Parameters:
R- the type of result- Parameters:
result- The result of the operation performeddescription- Description of the timing - typically a description of what was timed/measuredduration- How long did the operation performed take- Returns:
- the
TimingWithResult
-
of
public static <R> TimingWithResult<R> of(R result, Duration duration)
Create a newTimingWithResult- Type Parameters:
R- the type of result- Parameters:
result- The result of the operation performedduration- 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
-
-