Package org.kiwiproject.beta.time
Class Timing.TimedWithResult<R>
java.lang.Object
org.kiwiproject.beta.time.Timing.TimedWithResult<R>
- Type Parameters:
R- the result type
- All Implemented Interfaces:
Timing.Timed
- Enclosing class:
- Timing
Represents an operation that is timed and returns a result.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglonginthashCode()static <R> Timing.TimedWithResult<R>ofElapsedMillis(long elapsedMillis, R result) Create an instance having elapsed milliseconds and a result.static <R> Timing.TimedWithResult<R>ofElapsedNanos(long elapsedNanos, R result) Create an instance having elapsed nanoseconds and a result.toString()
-
Constructor Details
-
TimedWithResult
@ConstructorProperties({"elapsedMillis","result"}) public TimedWithResult(long elapsedMillis, R result)
-
-
Method Details
-
ofElapsedMillis
Create an instance having elapsed milliseconds and a result.- Type Parameters:
R- the type of result returned by the operation- Parameters:
elapsedMillis- the elapsed millisecondsresult- the result of the operation- Returns:
- a new instance
-
ofElapsedNanos
Create an instance having elapsed nanoseconds and a result.- Type Parameters:
R- the type of result returned by the operation- Parameters:
elapsedNanos- the elapsed nanosecondsresult- the result of the operation- Returns:
- a new instance
-
getElapsedNanos
public long getElapsedNanos()- Specified by:
getElapsedNanosin interfaceTiming.Timed- Returns:
- the number of nanoseconds that elapsed during the operation
-
getElapsedMillis
public long getElapsedMillis()- Specified by:
getElapsedMillisin interfaceTiming.Timed- Returns:
- the number of milliseconds that elapsed during the operation
-
getResult
-
toString
-
equals
-
hashCode
public int hashCode()
-