kotools / types

Explicit types for Kotlin Multiplatform.
https://types.kotools.org
MIT License
90 stars 6 forks source link

βͺ️ Restore factory functions of `Zero` and `EmailAddress` to v4.5.1 #681

Closed LVMVRQUXL closed 3 months ago

LVMVRQUXL commented 3 months ago

πŸ“ Description

We want to restore factory functions introduced for the Zero and the EmailAddress types in the version 4.5.1, instead of those introduced for the version 4.5.2, for taking more time to think about the right way for creating instances of a type.

class Zero constructor() {
    companion object {
        fun fromByte(number: Byte): Zero = TODO()
        fun fromByteOrNull(number: Byte): Zero? = TODO()
    }
}

class EmailAddress {
    companion object {
        fun fromString(value: Any): EmailAddress = TODO()
        fun fromString(value: Any, pattern: Any): EmailAddress = TODO()
        fun fromStringOrNull(value: Any): EmailAddress? = TODO()
        fun fromStringOrNull(value: Any, pattern: Any): EmailAddress? = TODO()
    }
}

βœ… Checklist