Package de.danielbechler.diff.comparison
Enum Class PrimitiveDefaultValueMode
java.lang.Object
java.lang.Enum<PrimitiveDefaultValueMode>
de.danielbechler.diff.comparison.PrimitiveDefaultValueMode
- All Implemented Interfaces:
Serializable,Comparable<PrimitiveDefaultValueMode>,Constable
Defines how default values of primitive types (int, long, short, byte, char, boolean, float, double) will
be treated. A default value is either the one specified by the JDK (numbers are 0, booleans are false) or
the value of the corresponding property when a new instance of its holding class gets created. In order to
determine the proper default value, we'll attempt to instantiate the holding class once via its public
constructor. If this instantiation fails (for example if there is no such constructor), we'll fall back to
the JDK default. This configuration does not apply to the corresponding wrapper types (Integer, Long,
Short, Byte, Character, Boolean, Float, Double).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDefault values of primitive types will be treated like any other value.Default values of primitive types will be treated as if the property has not been set. -
Method Summary
Modifier and TypeMethodDescriptionstatic PrimitiveDefaultValueModeReturns the enum constant of this class with the specified name.static PrimitiveDefaultValueMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ASSIGNED
Default values of primitive types will be treated like any other value. Since there is no distinction, any change to a primitive value will be marked as DiffNode.State.CHANGED. -
UNASSIGNED
Default values of primitive types will be treated as if the property has not been set. The consequence of this is that a change from default value to something else will be marked as DiffNode.State.ADDED and from something else to the default value as DiffNode.State.REMOVED.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-