validate

inline fun <T> T.validate(isValid: Boolean, invalidBlock: (T) -> Unit): T(source)

If isValid is true, executes invalidBlock. Used mainly for validating entities -> do something when validation failed.


inline fun <T> T.validate(isValidSelector: (T) -> Boolean, invalidBlock: (T) -> Unit): T(source)

If isValidSelector returns true, executes invalidBlock. Used mainly for validating entities -> do something when validation failed.