Package kotools.types.string

Types

NotBlankString
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "1.2")
interface NotBlankString : Comparable<NotBlankString>

Representation of strings that have at least one character, excluding whitespaces.

Functions

compareTo
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "2.0")
infix operator fun String.compareTo(other: NotBlankString): Int

Compares this value lexicographically with the other value for order. Returns zero if this value equals the other value, a negative number if this value is less than the other value, or a positive number if this value is greater than the other value.

getOrNull
Link copied to clipboard
infix fun NotBlankString.getOrNull(index: PositiveInt): Char?

Returns the character of this value at the specified index, or returns null if the index is out of bounds.

native
infix fun NotBlankString.getOrNull(index: PositiveInt): Char?

Returns the character of this value at the specified index, or returns null if the index is out of bounds.

NotBlankString
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "1.2")
fun NotBlankString(value: String): NotBlankString

Returns the value as a NotBlankString, or throws an NotBlankString.ConstructionError if the value is blank.

NotBlankStringOrNull
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "3.2", stability = StabilityLevel.Alpha)
fun notBlankStringOrNull(value: String): NotBlankString?

Returns the value as a NotBlankString, or returns null if the value is blank.

notBlankStringOrThrow
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "3.2", stability = StabilityLevel.Alpha)
fun notBlankStringOrThrow(value: String): NotBlankString

Returns the value as a NotBlankString, or throws an IllegalArgumentException if the value is blank.

toNotBlankString
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "1.2")
fun String.toNotBlankString(): NotBlankString

Returns this value as a NotBlankString, or throws an NotBlankString.ConstructionError if this value is blank.

toNotBlankStringOrNull
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "1.2")
fun String.toNotBlankStringOrNull(): NotBlankString?

Returns this value as a NotBlankString, or returns null if this value is blank.

toNotBlankStringOrThrow
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "3.2", stability = StabilityLevel.Alpha)
fun String.toNotBlankStringOrThrow(): NotBlankString

Returns this value as a NotBlankString, or throws an IllegalArgumentException if this value is blank.