Package dev.omnist.document
Record Class TimeValue
java.lang.Object
java.lang.Record
dev.omnist.document.TimeValue
- Record Components:
time- the time of day (required)offset- the UTC zone offset, or null if un-offset
Represents a time of day with optional UTC offset (omnist-spec ยง2.2.1).
-
Constructor Summary
ConstructorsConstructorDescriptionTimeValue(LocalTime time, ZoneOffset offset) Creates an instance of aTimeValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.format()Formats this value as an ISO-8601 string suitable for OML and codec serialization.final inthashCode()Returns a hash code value for this object.static TimeValueCreates an un-offset time (local time with no UTC offset).static TimeValueof(LocalTime time, ZoneOffset offset) Creates an offset time with an explicit UTC offset.offset()Returns the value of theoffsetrecord component.time()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates an un-offset time (local time with no UTC offset).- Parameters:
time- the time of day; must not benull- Returns:
- a new
TimeValuewithoffset == null
-
of
Creates an offset time with an explicit UTC offset.- Parameters:
time- the time of day; must not benulloffset- the UTC zone offset (e.g.ZoneOffset.UTC); may benullto produce an un-offset value- Returns:
- a new
TimeValue
-
format
Formats this value as an ISO-8601 string suitable for OML and codec serialization. The format isHH:MM:SS[.fractional]optionally followed byZfor UTC or a numeric offset such as+05:30. Un-offset values omit the trailing timezone designator entirely.- Returns:
- the ISO-8601 formatted string; never
null
-
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). -
time
Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-