Enum Class PrimitiveDefaultValueMode

java.lang.Object
java.lang.Enum<PrimitiveDefaultValueMode>
de.danielbechler.diff.comparison.PrimitiveDefaultValueMode
All Implemented Interfaces:
Serializable, Comparable<PrimitiveDefaultValueMode>, Constable

public enum PrimitiveDefaultValueMode extends Enum<PrimitiveDefaultValueMode>
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).
  • Enum Constant Details

    • ASSIGNED

      public static final PrimitiveDefaultValueMode 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

      public static final PrimitiveDefaultValueMode 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

      public static PrimitiveDefaultValueMode[] 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

      public static PrimitiveDefaultValueMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null