validate

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

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

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