object Companion
source · line 40public
public companion : ValueEncoder<UtcOffset>, ValueDecoder<UtcOffset>
- Supertype
ValueEncoder<UtcOffset> - Supertype
ValueDecoder<UtcOffset>
Value construction and serialization helpers.
function parseOrNone
source · line 76public
public fun parseOrNone(text: String): UtcOffset?
Parses Z or a signed HH:MM offset with optional seconds, returning None for malformed or out-of-range input.
parameter text
source · line 76public
text: String
function fromTotalSeconds
source · line 58public
public fun fromTotalSeconds(value: Int): UtcOffset
Constructs a fixed offset in -64800..64800 seconds.
parameter value
source · line 58public
value: Int
function fromHoursMinutesSeconds
source · line 65public
public fun fromHoursMinutesSeconds(hours: Int = 0, minutes: Int = 0, seconds: Int = 0): UtcOffset
Combines offset components of consistent sign, rejecting totals beyond 18 hours.
parameter minutes
source · line 65public
minutes: Int = 0
parameter seconds
source · line 65public
seconds: Int = 0
parameter hours
source · line 65public
hours: Int = 0
property ZERO
source · line 54public
public val ZERO: UtcOffset
get: public read-only
The zero UTC offset.
function parse
source · line 96public
public fun parse(text: String): UtcOffset
Parses Z or a signed HH:MM offset with optional seconds or throws IllegalArgumentException for invalid input.
parameter text
source · line 96public
text: String
function decode
source · line 48public
public override fun decode(decoder: Decoder): UtcOffset
- Overrides
decode
Reads a string value and validates it using this type's parser.
parameter decoder
source · line 48public
decoder: Decoder
function encode
source · line 44public
public override fun encode(value: UtcOffset, encoder: Encoder): Unit
- Overrides
encode
Encodes the value as its canonical text representation.
parameter value
source · line 44public
value: UtcOffset
parameter encoder
source · line 44public
encoder: Encoder