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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
This enum is used to identify the runtime type of anAttributeDifference
. -
Constructor Summary
ConstructorDescriptionAttributeDifference
(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 -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(AttributeDifference<?> o) boolean
Returns the type of this instance.Returns the log message for this differenceReturns the value of the compared property in the second documentReturns the descriptor for the new value, which is the formatted new value objectReturns the value of the compared property in the first documentReturns the descriptor for the old value, which is the formatted old value object
-
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 typeoldValue
- the old valuenewValue
- the new valuemessageKey
- the message key- Since:
- 3.0
-
-
Method Details
-
getMessage
Returns the log message for this difference- Returns:
- the log message for this difference, never
null
- Since:
- 3.0
-
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<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
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
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
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
Returns the descriptor for the new value, which is the formatted new value object- Returns:
- the descriptor for the new value
- Since:
- 4.0
-