Record Class MonotonicEpoch
java.lang.Object
java.lang.Record
org.j7m.middleware.api.reliability.MonotonicEpoch
- Record Components:
- epoch authorityscope- epoch scopevalue- epoch value
- All Implemented Interfaces:
Serializable, Comparable<MonotonicEpoch>
public record MonotonicEpoch(String authority, String scope, long value)
extends Record
implements Comparable<MonotonicEpoch>, Serializable
Monotonic epoch within a named authority and scope.
The record is immutable, serializable, thread-safe, and comparable only within the same authority and scope.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMonotonicEpoch(String authority, String scope, long value) Creates a validated epoch. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthorityrecord component.intcompareTo(MonotonicEpoch other) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.longvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
MonotonicEpoch
Creates a validated epoch.- Throws:
IllegalArgumentException- when authority or scope is invalid, or the value is negative
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<MonotonicEpoch>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
authority
-
scope
-
value
-