Record Class AsyncStatus
java.lang.Object
java.lang.Record
zeroecho.pki.util.async.AsyncStatus
- Record Components:
state- lifecycle state (nevernull)updatedAt- last update time (nevernull)detailCode- optional stable, non-sensitive code suitable for audit and transportdetails- optional key/value details; values MUST NOT contain secrets
public record AsyncStatus(AsyncState state, Instant updatedAt, Optional<String> detailCode, Map<String,String> details)
extends Record
Non-sensitive status snapshot of an asynchronous operation.
This object is safe to expose via APIs and logs (assuming the producer respects the no-secrets constraint for detail fields).
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncStatus(AsyncState state, Instant updatedAt, Optional<String> detailCode, Map<String, String> details) Creates a status record and validates invariants. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedetailCoderecord component.details()Returns the value of thedetailsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether this status is terminal.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theupdatedAtrecord component.
-
Constructor Details
-
AsyncStatus
public AsyncStatus(AsyncState state, Instant updatedAt, Optional<String> detailCode, Map<String, String> details) Creates a status record and validates invariants.- Throws:
IllegalArgumentException- if any mandatory field is null
-
-
Method Details
-
isTerminal
public boolean isTerminal()Returns whether this status is terminal.- Returns:
- true if terminal
-
toString
-
hashCode
-
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). -
state
-
updatedAt
-
detailCode
Returns the value of thedetailCoderecord component.- Returns:
- the value of the
detailCoderecord component
-
details
-