checkStringNotEmpty

open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: @Nullable T): @NonNull T

Ensures that a string reference passed as a parameter to the calling method is not empty.

Return

the string reference that was validated

Parameters

string

a string reference

Throws


open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: @Nullable T, @NonNull errorMessage: @NonNull Any): @NonNull T

Ensures that a string reference passed as a parameter to the calling method is not empty.

Return

the string reference that was validated

Parameters

string

a string reference

errorMessage

the exception message to use if the check fails; will be converted to a string using valueOf

Throws


open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: @Nullable T, @NonNull messageTemplate: @NonNull String, messageArgs: @NonNull Array<Any>): @NonNull T

Ensures that a string reference passed as a parameter to the calling method is not empty.

Return

the string reference that was validated

Parameters

string

a string reference

messageTemplate

a printf-style message template to use if the check fails; will be converted to a string using format

messageArgs

arguments for messageTemplate

Throws