Record Class LifecycleRecord
- Record Components:
id- stable identifier for this item, unique within its trackerlabel- human-readable display namegroup- optional grouping label (e.g. the enclosing feature or declaring class), ornullwhen the source has no grouping conceptstageReachedAt- ordered map of stage name to the instant the item first reached that stagelastSeenAt- when the item was last observed present, ornullif never observedremovedAt- when the item was first observed missing, ornullwhile still present
TrackerSource.
stageReachedAt is ordered by the tracker's canonical stage sequence (e.g.
listed, defined, implemented) and only contains entries for stages the
item has actually reached; a stage never (yet) reached is simply absent from the map rather than
mapped to null.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.booleanhasReached(String stage) Whether this item has reachedstage.id()Returns the value of theidrecord component.booleanisActiveAsOf(Instant asOf) Whether this item was still active (present and not yet removed) as ofasOf.label()Returns the value of thelabelrecord component.Returns the value of thelastSeenAtrecord component.latestStage(List<String> canonicalStages) The furthest stage this item has reached, percanonicalStages' own order.latestStageAsOf(List<String> canonicalStages, Instant asOf) The furthest stage this item had reached as ofasOf, percanonicalStages' own order - the historical generalization oflatestStage(List), which is simply this method evaluated as of the present.Returns the value of theremovedAtrecord component.Returns the value of thestageReachedAtrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
hasReached
Whether this item has reachedstage.- Parameters:
stage- the stage name to check- Returns:
trueifstageReachedAtcontainsstage
-
latestStage
The furthest stage this item has reached, percanonicalStages' own order.Not simply "the highest-index key present in
stageReachedAt()", since someTrackerSources stamp only the single stage matching an item's current status rather than backfilling every earlier stage it must logically have passed through - the Gherkin scenario source, for one, never gains adefinedentry for a scenario first observed alreadyimplemented. This walkscanonicalStagesfrom the end instead, so it always reports the furthest reached stage regardless of which earlier ones were skipped.Equivalent to
latestStageAsOf(List, Instant)evaluated "as of" the present - every entry instageReachedAt()was, by construction, reached at or before now, soInstant.MAXas the upper bound never excludes anything.- Parameters:
canonicalStages- the tracker's canonical stage names, in order- Returns:
- the furthest reached stage, or empty if none of
canonicalStageshas been reached
-
latestStageAsOf
The furthest stage this item had reached as ofasOf, percanonicalStages' own order - the historical generalization oflatestStage(List), which is simply this method evaluated as of the present.A stage only counts if it was reached at or before
asOf; a stage reached later is treated exactly as if it were never reached at all, so this always answers "what did this item's status look like atasOf," not "what does it look like now."- Parameters:
canonicalStages- the tracker's canonical stage names, in orderasOf- the instant to evaluate reached-ness as of, inclusive- Returns:
- the furthest stage reached at or before
asOf, or empty if none ofcanonicalStageshad been reached by then
-
isActiveAsOf
Whether this item was still active (present and not yet removed) as ofasOf.- Parameters:
asOf- the instant to evaluate as of, inclusive- Returns:
trueifremovedAt()isnullor strictly afterasOf
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
stageReachedAt
Returns the value of thestageReachedAtrecord component.- Returns:
- the value of the
stageReachedAtrecord component
-
lastSeenAt
Returns the value of thelastSeenAtrecord component.- Returns:
- the value of the
lastSeenAtrecord component
-
removedAt
Returns the value of theremovedAtrecord component.- Returns:
- the value of the
removedAtrecord component
-