kotools/types

โœจ New `ZeroAsByteSerializer` type

LVMVRQUXL opened this issue ยท 0 comments

๐Ÿ“ Description

In the types-kotlinx-serialization subproject, we want to introduce the ZeroAsByteSerializer experimental type for serializing the Zero type as Byte. This serializer should be available for all Kotlin platforms.

class ZeroAsByteSerializer : KSerializer<Zero> {
    override val descriptor: SerializerDescriptor

    override fun equals(other: Any?): Boolean
    override fun hashCode(): Int
    override fun serialize(encoder: Encoder, value: Zero)
    override fun deserialize(decoder: Decoder): Zero
    override fun toString(): String
}

Finally, we want to deprecate the KotoolsTypesSerializers.zero experimental property with an error level for using this new serializer instead.

โœ… Checklist

  • โœจ Add the type and its public constructor with tests, documentation and samples.
  • โœจ Override the toString method with tests, documentation and samples.
  • โœจ Override the equals method with tests, documentation and samples.
  • โœจ Override the hashCode method with tests, documentation and samples.
  • โœจ Make the type implementing the KSerializer<Zero> type with tests, documentation and samples.
  • ๐Ÿ—‘๏ธ Deprecate the KotoolsTypesSerializers.zero property.
  • ๐Ÿ“ Update the unreleased changelog for this issue.
  • ๐Ÿ“ Create another issue for removing the KotoolsTypesSerializers.zero deprecated property for the next iteration.