Class PropertyValidations
- java.lang.Object
-
- org.cyclos.impl.utils.validation.validations.PropertyValidations
-
public class PropertyValidations extends Object
Factory class for creatingPropertyValidationinstances
-
-
Constructor Summary
Constructors Constructor Description PropertyValidations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertyValidationallOf(Collection<?> values)A validation which ensures that the value (or all in case of collection) is contained in the the given possible valuesstatic PropertyValidationanyOf(Collection<?> values)A validation which ensures that the value is any of the given possible valuesstatic PropertyValidationcaptcha(String id)static PropertyValidationcharacterEncoding()A validation for character encodingsstatic PropertyValidationchildOf(Object parent, MessageKey parentKey)static PropertyValidationclassName(Class<?> superClass)A validation for a class name which needs to be a subclass of the given classstatic PropertyValidationcolor()A validation for colorsstatic PropertyValidationcomparable(Comparable<?> comparable, boolean acceptNegative, boolean acceptZero, boolean acceptPositive, ValidationError error)A validation for comparable objectsstatic PropertyValidationcomparable(Comparable<?> comparable, String operator, ValidationError error)A validation for comparable objectsstatic PropertyValidationdate()A validation for date.static PropertyValidationemail()A validation which ensures that the value is a valid e-mailstatic PropertyValidationfixedLength(int length)Ensures that an string has exactly the specified lengthstatic PropertyValidationfutureDate()A validation for dates in the futurestatic PropertyValidationfuturePeriod()A validation for periods in the futurestatic PropertyValidationgreaterEquals(Comparable<?> value)A validation which the value should be greater or equals than the one specifiedstatic PropertyValidationgreaterThan(Comparable<?> value)A validation which the value should be greater than the one specifiedstatic PropertyValidationidentifier()A validation for identifier, that is, contains only letters, numbers or underscores and starts with a letterstatic PropertyValidationinternetAddress()A validation for Internet addressesstatic PropertyValidationinternetAddressList()A validation which checks if a given string is a valid list of internet addresses, according toInternetAddressHelper.isInternetAddressList(String)static PropertyValidationinvalid(boolean handleEmpty, ValidationError error)A validation which always returns invalidstatic PropertyValidationlatLong()A validation forLatLongDTOstatic PropertyValidationlessEquals(Comparable<?> value)A validation which the value should be less or equals than the one specifiedstatic PropertyValidationlessThan(Comparable<?> value)A validation which the value should be less than the one specifiedstatic PropertyValidationmask(int minimumPlaceholders)static PropertyValidationmaskValue(String mask)static PropertyValidationmaxElements(int amount)Indicates the maximum elements a collection / map / array can containsstatic PropertyValidationmaxInterval(ITimeInterval interval)Indicates the maximum accepted time intervalstatic PropertyValidationmaxLength(int length)A validation that checks the maximum string lengthstatic PropertyValidationmaxWordSize(int length)A validation that check words cannot exceed the given lengthstatic PropertyValidationminElements(int amount)Indicates the minimum elements a collection can containsstatic PropertyValidationminInterval(ITimeInterval interval)Indicates the minimum accepted time intervalstatic PropertyValidationminLength(int length)A validation that checks the minimum string lengthstatic PropertyValidationmustBeInstanceOf(Class<? extends BaseEntity> entityType)A validation that a VO should be an instance of the given entity typestatic PropertyValidationnegativeNonZero(int scale)A validation for negative and non-zero numeric propertiesstatic PropertyValidationnegativeOrZero()A validation for negative or zero numeric propertiesstatic PropertyValidationnoFuturePeriod()A validation for periods to ensure that they're not entirely in the future.static PropertyValidationnoneOf(Collection<?> values)A validation which ensures that the value is none of the given possible valuesstatic PropertyValidationnoPropertyOf(Collection<Class<?>> values)A validation which ensures that the value is none of the properties of the given classesstatic PropertyValidationpastDate()A validation for dates in the paststatic PropertyValidationperiod()A validation which ensures that period bounds are validstatic PropertyValidationphone(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)static PropertyValidationpositiveNonZero()A validation for positive and non-zero numeric propertiesstatic PropertyValidationpositiveNonZero(int scale)A validation for positive and non-zero numeric propertiesstatic PropertyValidationpositiveOrZero()A validation for positive or zero numeric propertiesstatic PropertyValidationpositiveOrZero(int scale)A validation for positive or zero numeric propertiesstatic PropertyValidationrange(RangeOptionalType type)A validation that a range min is less or equal the range max, optionally requiring the limitsstatic PropertyValidationregex(String regex)A validation for a regular expression matchstatic PropertyValidationrequired()A validation for required propertiesstatic PropertyValidationunique(String key, com.querydsl.jpa.impl.AbstractJPAQuery<?,?> query)A validation for unique records.static PropertyValidationurl()A validation for URLs
-
-
-
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
-
captcha
public static PropertyValidation captcha(String id)
-
characterEncoding
public static PropertyValidation characterEncoding()
A validation for character encodings
-
childOf
public static PropertyValidation childOf(Object parent, MessageKey parentKey)
-
className
public static PropertyValidation className(Class<?> superClass)
A validation for a class name which needs to be a subclass of the given class
-
color
public static PropertyValidation color()
A validation for colors
-
comparable
public static PropertyValidation comparable(Comparable<?> comparable, boolean acceptNegative, boolean acceptZero, boolean acceptPositive, ValidationError error)
A validation for comparable objects
-
comparable
public static PropertyValidation comparable(Comparable<?> comparable, String operator, 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
-
internetAddressList
public static PropertyValidation internetAddressList()
A validation which checks if a given string is a valid list of internet addresses, according toInternetAddressHelper.isInternetAddressList(String)
-
invalid
public static PropertyValidation invalid(boolean handleEmpty, ValidationError error)
A validation which always returns invalid
-
latLong
public static PropertyValidation latLong()
A validation forLatLongDTO
-
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
-
mask
public static PropertyValidation mask(int minimumPlaceholders)
-
maskValue
public static PropertyValidation maskValue(String mask)
-
maxElements
public static PropertyValidation maxElements(int amount)
Indicates the maximum elements a collection / map / array can contains
-
maxInterval
public static PropertyValidation maxInterval(ITimeInterval interval)
Indicates the maximum accepted time interval
-
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
-
minInterval
public static PropertyValidation minInterval(ITimeInterval interval)
Indicates the minimum accepted time interval
-
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
-
range
public static PropertyValidation range(RangeOptionalType type)
A validation that a range min is less or equal the range max, optionally requiring the limits
-
regex
public static PropertyValidation regex(String regex)
A validation for a regular expression match
-
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
-
url
public static PropertyValidation url()
A validation for URLs
-
-