Class AttributeDifference<T>

java.lang.Object
com.inet.pdfc.generator.model.diff.AttributeDifference<T>
Type Parameters:
T - the type of the value which has a difference
All Implemented Interfaces:
Serializable, Comparable<AttributeDifference<?>>

@JsonData public abstract class AttributeDifference<T> extends Object implements Comparable<AttributeDifference<?>>, Serializable
Basic class for difference descriptions
Since:
3.0
See Also:
  • Constructor Details

    • AttributeDifference

      public AttributeDifference(AttributeDifference.TYPE instanceType, T oldValue, T newValue, String messageKey)
      Creates an instance with an old and a new value and sets the instanceType and the messageKey
      Parameters:
      instanceType - the instance type
      oldValue - the old value
      newValue - the new value
      messageKey - the message key
      Since:
      3.0
  • Method Details

    • getMessage

      public String getMessage()
      Returns the log message for this difference
      Returns:
      the log message for this difference, never null
      Since:
      3.0
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(AttributeDifference<?> o)
      Specified by:
      compareTo in interface Comparable<T>
    • getOldValue

      public T getOldValue()
      Returns the value of the compared property in the first document
      Returns:
      the value of the compared property in the first document
      Since:
      3.0
    • getNewValue

      public T getNewValue()
      Returns the value of the compared property in the second document
      Returns:
      the value of the compared property in the second document
      Since:
      3.0
    • getInstanceType

      public AttributeDifference.TYPE getInstanceType()
      Returns the type of this instance. This type is the only information about the actual type of the difference if the model was JSON serialized
      Returns:
      the instanceType, not null
      Since:
      4.0
    • getOldValueDescriptor

      public String getOldValueDescriptor()
      Returns the descriptor for the old value, which is the formatted old value object
      Returns:
      the descriptor for the old value
      Since:
      4.0
    • getNewValueDescriptor

      public String getNewValueDescriptor()
      Returns the descriptor for the new value, which is the formatted new value object
      Returns:
      the descriptor for the new value
      Since:
      4.0