InstantAsLongSerializer


@RequiresApi(api = Build.VERSION_CODES.O)
class InstantAsLongSerializer : LongSerializer


Serializes a Instant to and from a long. The Instant is serialized and deserialized from and to epoch milliseconds.

Summary

Public constructors

Public functions

Instant
deserialize(epochMilli: Long)

Deserializes a long to an Instant.

Long
serialize(instant: Instant)

Serializes an Instant to a long.

Public constructors

InstantAsLongSerializer

Added in 1.2.0-alpha01
InstantAsLongSerializer()

Public functions

deserialize

Added in 1.2.0-alpha01
fun deserialize(epochMilli: Long): Instant

Deserializes a long to an Instant.

Parameters
epochMilli: Long

The long to deserialize.

Returns
Instant

The Instant deserialized from the long.

serialize

Added in 1.2.0-alpha01
fun serialize(instant: Instant): Long

Serializes an Instant to a long.

Parameters
instant: Instant

The Instant to serialize.

Returns
Long

The long serialized from the Instant.