Utils

open class Utils(source)

Any kind of utility.

Author

Federico Tomassetti

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun assertNonEmpty(string: String): String
Link copied to clipboard
open fun <T : Number?> assertNonNegative(number: T): T
Link copied to clipboard
open fun <T> assertNotNull(o: T): T
Link copied to clipboard
open fun <T : Number?> assertPositive(number: T): T
Link copied to clipboard
Link copied to clipboard
open fun capitalize(s: String): String
Capitalizes the first character in the string.
Link copied to clipboard
open fun decapitalize(s: String): String
Lower-cases the first character in the string.
Link copied to clipboard
open fun escapeEndOfLines(string: String): String
Link copied to clipboard
Checks, if the parent is a unary expression with a minus operator.
Link copied to clipboard
open fun indent(builder: StringBuilder, indentLevel: Int): StringBuilder
Make an indent by appending indentLevel tab characters to the builder.
Link copied to clipboard
open fun <E> indexOfElementByObjectIdentity(list: List<E>, o: E): Int
Like indexOf, but using ==, not equals.
Link copied to clipboard
open fun <E> isNullOrEmpty(collection: Collection<E>): Boolean
Link copied to clipboard
open fun nextWord(string: String): String
Return the next word of the string, in other words it stops when a space is encountered.
Link copied to clipboard
open fun normalizeEolInTextBlock(content: String, desiredEndOfLineCharacter: LineSeparator): String
open fun normalizeEolInTextBlock(content: String, desiredEndOfLineCharacter: String): String
Link copied to clipboard
open fun readerToString(reader: Reader): String
Link copied to clipboard
open fun <E> removeElementByObjectIdentity(list: List<E>, o: E)
Like remove, but using ==, not equals.
Link copied to clipboard
open fun removeFileExtension(filename: String): String
Link copied to clipboard
open fun <E> replaceElementByObjectIdentity(list: List<E>, oldObject: E, newObject: E)
Like set at indexOf, but using ==, not equals.
Link copied to clipboard
open fun screamingToCamelCase(original: String): String
Transform a string to the camel case conversion.
Link copied to clipboard
open fun <T> set(items: Array<T>): Set<T>
Link copied to clipboard
open fun toCamelCase(original: String): String
Link copied to clipboard
Like trim, but only the trailing spaces.
Link copied to clipboard
open fun valueIsNullOrEmpty(value: Any): Boolean