Skip to content
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 NotBlankString type in org.kotools.types package #638

Open
13 tasks
LVMVRQUXL opened this issue Mar 31, 2024 · 0 comments
Open
13 tasks

✨ New NotBlankString type in org.kotools.types package #638

LVMVRQUXL opened this issue Mar 31, 2024 · 0 comments
Labels
common Item related to all platforms. feature New feature or request.

Comments

@LVMVRQUXL
Copy link
Contributor

LVMVRQUXL commented Mar 31, 2024

πŸ“ Description

We want to introduce a NotBlankString experimental type, in the org.kotools.types package of the types Gradle subproject, for representing a string that has at least one character excluding whitespaces. This type should be serializable as String.

This type should have the following Application Programming Interface (API):

interface NotBlankString : Comparable<NotBlankString> {
    val length: PositiveInt
    
    override fun equals(other: Any?): Boolean
    override fun hashCode(): Int
    
    override fun compareTo(other: NotBlankString): Int
    
    operator fun plus(other: Any): NotBlankString
    
    override fun toString(): String
    
    companion object {
        fun fromString(value: Any): NotBlankString
        fun fromStringOrNull(value: Any): NotBlankString?
        
        fun random(): NotBlankString = TODO()
        fun random(length: PositiveInt): NotBlankString = TODO()
    }
}

πŸ”— Dependencies

This issue is blocked by the following ones:

βœ… Checklist

  • ✨ Add the type with a private constructor and dump the Application Binary Interface (ABI).
  • ✨ Add the fromStringOrNull(Any) function with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the fromString(Any) function with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the random() function with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the random(PositiveInt) function with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the length property with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the structural equality operations (equals(Any?) and hashCode() functions) with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Implement the Comparable interface with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the plus(Any) function with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Add the toString() function with tests, tested code samples for Kotlin and Java code, and dump the ABI.
  • ✨ Make the type serializable as String with tests, tested code samples for Kotlin, and dump the ABI.
  • πŸ“ Add an entry for this issue in the unreleased changelog.
@LVMVRQUXL LVMVRQUXL added feature New feature or request. common Item related to all platforms. labels Mar 31, 2024
@LVMVRQUXL LVMVRQUXL added this to the 4.6.0 milestone Mar 31, 2024
@LVMVRQUXL LVMVRQUXL modified the milestones: 4.6.0, 4.5.1 Apr 13, 2024
@LVMVRQUXL LVMVRQUXL modified the milestone: 4.5.2 May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Item related to all platforms. feature New feature or request.
Projects
None yet
Development

No branches or pull requests

1 participant