public static class Stopwatch.Checkpoint extends Object implements Comparable<Stopwatch.Checkpoint>, TemporalAccessor
Modifier | Constructor and Description |
---|---|
protected |
Checkpoint(Stopwatch stopwatch,
String name,
Instant instant,
Optional<Stopwatch.Checkpoint> previousCheckpoint)
Creates a new
Checkpoint instance. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
int |
compareTo(Stopwatch.Checkpoint object) |
boolean |
equals(Object o) |
Instant |
getInstant()
Instant
|
long |
getLong(TemporalField field) |
String |
getName()
Checkpoints name as reference
|
Optional<Stopwatch.Checkpoint> |
getPreviousCheckpoint()
Previous checkpoint or empty if this is the stopwatches first checkpoint
|
Instant |
getPreviousInstant()
Instant of the previous
Stopwatch.Checkpoint or the stopwatches starting time
if this is the first checkpoint |
Stopwatch |
getStopwatch()
Stopwatch
|
int |
hashCode() |
boolean |
isSupported(TemporalField field) |
Duration |
sincePrevious()
Duration between this checkpoint and the previous
Stopwatch.Checkpoint or the
stopwatches starting time if this is the first checkpoint |
Duration |
sinceStart()
Duration between this checkpoint and the stopwatches start
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
get, query, range
protected Checkpoint(Stopwatch stopwatch, String name, Instant instant, Optional<Stopwatch.Checkpoint> previousCheckpoint)
Checkpoint
instance.stopwatch
- Stopwatchname
- Checkpoints name as referenceinstant
- InstantpreviousCheckpoint
- Previous checkpoint or empty if this is the stopwatches first checkpointpublic int compareTo(@Nullable Stopwatch.Checkpoint object)
compareTo
in interface Comparable<Stopwatch.Checkpoint>
public long getLong(@Nullable TemporalField field)
getLong
in interface TemporalAccessor
public Instant getPreviousInstant()
Stopwatch.Checkpoint
or the stopwatches starting time
if this is the first checkpointpublic boolean isSupported(@Nullable TemporalField field)
isSupported
in interface TemporalAccessor
public Duration sincePrevious()
Stopwatch.Checkpoint
or the
stopwatches starting time if this is the first checkpointpublic Duration sinceStart()
public Stopwatch getStopwatch()
public String getName()
public Instant getInstant()
public Optional<Stopwatch.Checkpoint> getPreviousCheckpoint()
protected boolean canEqual(@Nullable Object other)
Copyright © 2025. All rights reserved.