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:
java.io.Serializable
,java.lang.Comparable<AttributeDifference<?>>
@JsonData public abstract class AttributeDifference<T> extends java.lang.Object implements java.lang.Comparable<AttributeDifference<?>>, java.io.Serializable
Basic class for difference descriptions- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeDifference.TYPE
This enum is used to identify the runtime type of anAttributeDifference
.
-
Constructor Summary
Constructors Constructor Description AttributeDifference(AttributeDifference.TYPE instanceType, T oldValue, T newValue, java.lang.String messageKey)
Creates an instance with an old and a new value and sets the instanceType and the messageKey
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AttributeDifference<?> o)
boolean
equals(java.lang.Object obj)
AttributeDifference.TYPE
getInstanceType()
Returns the type of this instance.java.lang.String
getMessage()
Returns the log message for this differenceT
getNewValue()
Returns the value of the compared property in the second documentjava.lang.String
getNewValueDescriptor()
Returns the descriptor for the new value, which is the formatted new value objectT
getOldValue()
Returns the value of the compared property in the first documentjava.lang.String
getOldValueDescriptor()
Returns the descriptor for the old value, which is the formatted old value object
-
-
-
Constructor Detail
-
AttributeDifference
public AttributeDifference(AttributeDifference.TYPE instanceType, T oldValue, T newValue, java.lang.String messageKey)
Creates an instance with an old and a new value and sets the instanceType and the messageKey- Parameters:
instanceType
- the instance typeoldValue
- the old valuenewValue
- the new valuemessageKey
- the message key- Since:
- 3.0
-
-
Method Detail
-
getMessage
public java.lang.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(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(AttributeDifference<?> o)
- Specified by:
compareTo
in interfacejava.lang.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 java.lang.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 java.lang.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
-
-