Module de.carne

Interface Conversion<I,​O>

  • Type Parameters:
    I - the actual input type.
    O - the actual output type.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Conversion<I,​O>
    Functional interface used to define an conversion step during an input validation.
    • Method Detail

      • checkAndApply

        @Nullable O checkAndApply​(I input)
                           throws java.lang.Exception
        Checks the given input value and applies the conversion.
        Parameters:
        input - the input value to convert.
        Returns:
        the converted value or null if the input value is not valid.
        Throws:
        java.lang.Exception - if the conversion fails.