Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.04 KB

README.md

File metadata and controls

61 lines (45 loc) · 1.04 KB

kotlin-commons

An kotlin library which provides common extension utility functions

String Extensions

whenBlank

Executes action if this string is empty or consists solely of whitespace characters.

whenNotBlank

Executes action if this string is not consists of solely whitespace characters.

whenWhiteSpacesAtBeginning

Executes action if this string is not consists of solely whitespace characters and starts with space.

whenWhiteSpacesAtEnd

Executes action if this string is not consists of solely whitespace characters and ends with space.

whenEmpty

Executes action if this char sequence is empty (contains no characters).

Nullable Extensions

whenNull

Executes action if this nullable is null

whenNotNull

Executes action if this nullable is non null

Int Extensions

whenPositive

Executes action if int is positive.

whenNegative

Executes action if this int is negative.

whenZero

Executes action if this int is zero.