Class TransformAndCheckFunction<T>

    • Field Detail

      • preprocessor

        private final Function<T,​? extends T> preprocessor
        A function applied to input prior to being constraint checked and accepted.
      • constraint

        private final Predicate<T> constraint
        A constraint which must be met in order for an input to be valid.
      • failOnConstraintViolation

        private final boolean failOnConstraintViolation
        Whether input that does not meet the constraint should cause an error or just be silently dropped.
    • Constructor Detail

      • TransformAndCheckFunction

        public TransformAndCheckFunction​(@Nonnull
                                         Function<T,​? extends T> inputPreprocessor,
                                         @Nonnull
                                         Predicate<T> inputConstraint,
                                         boolean failOnInputConstraintViolation)
        Constructor.
        Parameters:
        inputPreprocessor - function applied to input prior to being constraint checked and accepted
        inputConstraint - constraint which must be met in order for an input to be valid
        failOnInputConstraintViolation - whether input that does not meet the constraint should cause an error or just be ignored