Package org.ametys.cms.content.compare
Class ContentComparatorResult
java.lang.Object
org.ametys.cms.content.compare.ContentComparatorResult
Result of a comparison between 2 data holders of a content.
-
Constructor Summary
ConstructorsConstructorDescriptionContentComparatorResult
(ModelAwareDataHolder dataHolder1, ModelAwareDataHolder dataHolder2) Create a new result from 2 data holdersContentComparatorResult
(ModelAwareDataHolder dataHolder1, ModelAwareDataHolder dataHolder2, ViewItemAccessor viewItemAccessor) Create a new result from 2 data holders and the view item accessor used for comparison -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChange
(ContentComparatorChange change) Add a change to the listboolean
Are the data holders equals ?If data holders are not equals, a list ofContentComparatorChange
is generatedGet the content of the 1st data holder of the comparisonGet the content of the 2nd data holder of the comparisonGet the 1st data holder of the comparisonGet the 2nd data holder of the comparisonget theViewItemAccessor
(generated from the view name, of from all attributes)void
Declare that the 2 data holders are not equalstoString()
-
Constructor Details
-
ContentComparatorResult
Create a new result from 2 data holders- Parameters:
dataHolder1
- 1st data holderdataHolder2
- 2nd data holder
-
ContentComparatorResult
public ContentComparatorResult(ModelAwareDataHolder dataHolder1, ModelAwareDataHolder dataHolder2, ViewItemAccessor viewItemAccessor) Create a new result from 2 data holders and the view item accessor used for comparison- Parameters:
dataHolder1
- 1st data holderdataHolder2
- 2nd data holderviewItemAccessor
-ViewItemAccessor
-
-
Method Details
-
areEquals
Are the data holders equals ?- Returns:
- true if equals
-
getChanges
If data holders are not equals, a list ofContentComparatorChange
is generated- Returns:
- list of
ContentComparatorChange
-
getDataHolder1
Get the 1st data holder of the comparison- Returns:
- 1st data holder
-
getDataHolder2
Get the 2nd data holder of the comparison- Returns:
- 2nd data holder
-
getContent1
Get the content of the 1st data holder of the comparison- Returns:
- content of the 1st data holder
-
getContent2
Get the content of the 2nd data holder of the comparison- Returns:
- content of the 2nd data holder
-
getViewItemAccessor
get theViewItemAccessor
(generated from the view name, of from all attributes)- Returns:
ViewItemAccessor
-
addChange
Add a change to the list- Parameters:
change
- a new change
-
setNotEquals
Declare that the 2 data holders are not equals -
toString
-