Class PropertyValidations

    • Constructor Detail

      • PropertyValidations

        public PropertyValidations()
    • Method Detail

      • allOf

        public static PropertyValidation allOf​(Collection<?> values)
        A validation which ensures that the value (or all in case of collection) is contained in the the given possible values
      • anyOf

        public static PropertyValidation anyOf​(Collection<?> values)
        A validation which ensures that the value is any of the given possible values
      • characterEncoding

        public static PropertyValidation characterEncoding()
        A validation for character encodings
      • className

        public static PropertyValidation className​(Class<?> superClass)
        A validation for a class name which needs to be a subclass of the given class
      • comparable

        public static PropertyValidation comparable​(Comparable<?> comparable,
                                                    boolean acceptNegative,
                                                    boolean acceptZero,
                                                    boolean acceptPositive,
                                                    ValidationError error)
        A validation for comparable objects
      • date

        public static PropertyValidation date()
        A validation for date. The date must be after the year 1900
      • email

        public static PropertyValidation email()
        A validation which ensures that the value is a valid e-mail
      • fixedLength

        public static PropertyValidation fixedLength​(int length)
        Ensures that an string has exactly the specified length
      • futureDate

        public static PropertyValidation futureDate()
        A validation for dates in the future
      • futurePeriod

        public static PropertyValidation futurePeriod()
        A validation for periods in the future
      • greaterEquals

        public static PropertyValidation greaterEquals​(Comparable<?> value)
        A validation which the value should be greater or equals than the one specified
      • greaterThan

        public static PropertyValidation greaterThan​(Comparable<?> value)
        A validation which the value should be greater than the one specified
      • identifier

        public static PropertyValidation identifier()
        A validation for identifier, that is, contains only letters, numbers or underscores and starts with a letter
      • internetAddress

        public static PropertyValidation internetAddress()
        A validation for Internet addresses
      • lessEquals

        public static PropertyValidation lessEquals​(Comparable<?> value)
        A validation which the value should be less or equals than the one specified
      • lessThan

        public static PropertyValidation lessThan​(Comparable<?> value)
        A validation which the value should be less than the one specified
      • maxElements

        public static PropertyValidation maxElements​(int amount)
        Indicates the maximum elements a collection / map / array can contains
      • maxLength

        public static PropertyValidation maxLength​(int length)
        A validation that checks the maximum string length
      • maxWordSize

        public static PropertyValidation maxWordSize​(int length)
        A validation that check words cannot exceed the given length
      • minElements

        public static PropertyValidation minElements​(int amount)
        Indicates the minimum elements a collection can contains
      • minLength

        public static PropertyValidation minLength​(int length)
        A validation that checks the minimum string length
      • mustBeInstanceOf

        public static PropertyValidation mustBeInstanceOf​(Class<? extends BaseEntity> entityType)
        A validation that a VO should be an instance of the given entity type
      • negativeNonZero

        public static PropertyValidation negativeNonZero​(int scale)
        A validation for negative and non-zero numeric properties
      • negativeOrZero

        public static PropertyValidation negativeOrZero()
        A validation for negative or zero numeric properties
      • noFuturePeriod

        public static PropertyValidation noFuturePeriod()
        A validation for periods to ensure that they're not entirely in the future.
      • noneOf

        public static PropertyValidation noneOf​(Collection<?> values)
        A validation which ensures that the value is none of the given possible values
      • noPropertyOf

        public static PropertyValidation noPropertyOf​(Collection<Class<?>> values)
        A validation which ensures that the value is none of the properties of the given classes
      • pastDate

        public static PropertyValidation pastDate()
        A validation for dates in the past
      • period

        public static PropertyValidation period()
        A validation which ensures that period bounds are valid
      • phone

        public static PropertyValidation phone​(String defaultCountry,
                                               PhoneNature expectedNature)
        A validation for a phone number on a given default region (normally the country code) and a nature (land line or mobile)
      • positiveNonZero

        public static PropertyValidation positiveNonZero()
        A validation for positive and non-zero numeric properties
      • positiveNonZero

        public static PropertyValidation positiveNonZero​(int scale)
        A validation for positive and non-zero numeric properties
      • positiveOrZero

        public static PropertyValidation positiveOrZero()
        A validation for positive or zero numeric properties
      • positiveOrZero

        public static PropertyValidation positiveOrZero​(int scale)
        A validation for positive or zero numeric properties
      • required

        public static PropertyValidation required()
        A validation for required properties
      • unique

        public static PropertyValidation unique​(String key,
                                                com.querydsl.jpa.impl.AbstractJPAQuery<?,​?> query)
        A validation for unique records. The given query must return no rows for the validation to pass