validate

abstract fun validate(value: V): Result<V>

Validates that the given value meets this invariant.

Return

A Result containing either the value if the invariant holds, or an error if it doesn't

Parameters

value

The value to validate