Enum FillType
- All Implemented Interfaces:
Serializable,Comparable<FillType>,java.lang.constant.Constable
Defines fill types for populating fields in existing objects when using
InstancioObjectApi.fill(). Each fill type specifies which fields
should be considered for population based on their current values.
Fill types follow a hierarchical structure where each subsequent type builds upon the behavior of the previous types, adding additional capabilities.
- Since:
- 5.3.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPopulates an object based solely on specified selectors.Populates allnullfields with random values and applies the specified selectors.Populates bothnullfields and primitive fields containing default values. -
Method Summary
-
Enum Constant Details
-
APPLY_SELECTORS
Populates an object based solely on specified selectors. Only the fields explicitly targeted by selectors are modified, while all other fields remain unchanged.- Since:
- 5.3.0
-
POPULATE_NULLS
Populates allnullfields with random values and applies the specified selectors. This includes the behaviour ofAPPLY_SELECTORSand adds population ofnullfields.Non-null fields remain unchanged unless explicitly targeted by selectors.
- Since:
- 5.3.0
-
POPULATE_NULLS_AND_DEFAULT_PRIMITIVES
Populates bothnullfields and primitive fields containing default values. This extends the behavior ofPOPULATE_NULLSby also addressing default primitive values.A primitive field is considered to have a default value if it contains:
0for numeric types (byte,short,int,long,float,double)falseforboolean' '(null character) forchar
For example:
- A
booleanfield with the valuefalsemay be randomized. - A
booleanfield with the valuetruewill remain unchanged. - An
intfield with the value0may be randomized. - An
intfield with any non-zero value will remain unchanged.
- Since:
- 5.3.0
-
-
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
-