-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
β¨ New PositiveInt
type in org.kotools.types
package
#637
Comments
LVMVRQUXL
added
feature
New feature or request.
common
Item related to all platforms.
labels
Mar 31, 2024
In the future, we could make instances of this type comparable with themselves and the integer types from the Kotlin standard library. interface PositiveInt : Comparable<PositiveInteger> {
operator fun compareTo(other: Byte): Int
operator fun compareTo(other: Short): Int
operator fun compareTo(other: Int): Int
operator fun compareTo(other: Long): Int
operator fun compareTo(other: PositiveInteger): Int
} |
In the future, we could add support for basic arithmetic operations |
In the future, we could provide additional conversions for the interface PositiveInt {
fun toByte(): Byte
fun toShort(): Short
fun toLong(): Long
fun toFloat(): Float
fun toDouble(): Double
} |
This was referenced Mar 31, 2024
LVMVRQUXL
changed the title
β¨ New
β¨ New May 3, 2024
PositiveInt
type in org.kotools.types
packagePositiveInteger
type
This comment was marked as outdated.
This comment was marked as outdated.
LVMVRQUXL
changed the title
β¨ New
β¨ New May 3, 2024
PositiveInteger
typePositiveInt
type in org.kotools.types
package
This type will be implemented internally for the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
π Description
We want to introduce a
PositiveInt
experimental type, in theorg.kotools.types
package of thetypes
Gradle subproject, for representing an integer of typeInt
that is greater than zero. This type should be serializable asInt
.Here's the Application Programming Interface (API) goal for this type:
π Dependencies
This issue is blocked by the following ones:
Zero
Β #650β Checklist
fromIntOrNull(Int)
function with tests, documentation and samples.fromInt(Int)
function with tests, documentation and samples.toInt()
function with tests, documentation and samples.toString()
function with tests, documentation and samples.equals(Any?)
andhashCode()
functions) with tests, documentation and samples.min
property with tests, documentation and samples.max
property with tests, documentation and samples.random()
function with tests, documentation and samples.KotoolsTypesSerializers.positiveInt
property for making this type serializable asInt
.Byte
andShort
types.The text was updated successfully, but these errors were encountered: