Interface ReturningValidator<R>

  • All Known Implementing Classes:
    EndingValidator

    public interface ReturningValidator<R>
    • Method Detail

      • orElseThrow

        <E extends RuntimeExceptionR orElseThrow​(E throwable)
        Type Parameters:
        E - the bound of the Exception that needs to be thrown when a rule is broken.
        Parameters:
        throwable - the Exception that needs to be thrown when a rule is broken.
        Returns:
        R the return type
      • orElseReturn

        R orElseReturn​(R other)
        Parameters:
        other - the backup/default return type if the validation fails.
        Returns:
        R the return type.