Package org.immutables.value
Enum Value.Style.ValidationMethod
- All Implemented Interfaces:
Serializable,Comparable<Value.Style.ValidationMethod>,java.lang.constant.Constable
- Enclosing class:
Value.Style
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis validation method is similar toNONEin that that there are no null checks.Disables null and mandatory attribute checks.Simple validation, verifying that non-null attributes have been provided.Validation using Java Bean Validation API (JSR 303). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Value.Style.ValidationMethodReturns the enum constant of this type with the specified name.static Value.Style.ValidationMethod[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NONE
Disables null and mandatory attribute checks. Any missing primitives will be initialized to their zero-based values:false,0,'\0'. Object references will be nulls. Any optional, default and collection attributes will be initialized with their appropriate default values regardless of this validation setting. -
MANDATORY_ONLY
This validation method is similar toNONEin that that there are no null checks. But all attributes which are not `@Default` or marked with `@Nullable` are still checked to be provided (even withnullvalues in case of object references. -
SIMPLE
Simple validation, verifying that non-null attributes have been provided. This is classic fail-fast, null-hostile behavior and works best in most cases. -
VALIDATION_API
Validation using Java Bean Validation API (JSR 303). It disables null checks, in favor or @javax.validation.constraints.NotNulland creates static validator per objects. To better control the usage of JSR 303 Validator objects or enable fail-fast null checks, please use custom validation mixin approach, where you create base abstract class or interface with default methods to provide `@Value.Check` which would explicitly call validation of your choice. Please see discussion and examples provided in the following github issue: immutables/immutables#26
-
-
Constructor Details
-
ValidationMethod
private ValidationMethod()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-