Interface Constraint<V>

  • Type Parameters:
    V - value type

    public interface Constraint<V>
    Perform a validation on data upon load.
    Since:
    4.0.0
    • Method Detail

      • required

        static <T extends AnnotationConstraint.Factory<T,​Objectrequired()
        Require a value to be present for fields marked with the annotation T.
        Type Parameters:
        T - marker annotation type
        Returns:
        new constraint factory
        Since:
        4.0.0
      • pattern

        static Constraint.Factory<Matches,​Stringpattern()
        Require values to match the pattern provided.

        Upon failure, an error message will be taken from the annotation.

        Returns:
        factory providing matching pattern test
        Since:
        4.0.0
      • localizedPattern

        static Constraint.Factory<Matches,​StringlocalizedPattern​(ResourceBundle bundle)
        Require values to match the pattern provided.

        Upon failure, an error message will be taken from bundle with a key defined in the annotation.

        Parameters:
        bundle - source for localized messages
        Returns:
        factory providing matching pattern test
        Since:
        4.0.0