Package org.ametys.cms.content.compare
Class ContentComparatorResult
- java.lang.Object
-
- org.ametys.cms.content.compare.ContentComparatorResult
-
public class ContentComparatorResult extends Object
Result of a comparison between 2 contents
-
-
Constructor Summary
Constructors Constructor Description ContentComparatorResult(Content content1, Content content2)Create a new result from 2 contentsContentComparatorResult(Content content1, Content content2, String viewName, View view)Create a new result from 2 contents and the name of a metadataSet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddChange(ContentComparatorChange change)add a change to the listbooleanareEquals()are the contents equals ?List<ContentComparatorChange>getChanges()If contents are not equals, a list ofContentComparatorChangeis generatedContentgetContent1()get the 1st content of the comparisonContentgetContent2()get the 1st content of the comparisonViewgetView()get theView(generated from the view name, of from all attributes)StringgetViewName()get the name of theViewprotected voidsetNotEquals()declare that the 2 contents are not equalsStringtoString()
-
-
-
Constructor Detail
-
ContentComparatorResult
public ContentComparatorResult(Content content1, Content content2)
Create a new result from 2 contents- Parameters:
content1- 1st contentcontent2- 2nd content
-
-
Method Detail
-
areEquals
public boolean areEquals()
are the contents equals ?- Returns:
- true if equals
-
getChanges
public List<ContentComparatorChange> getChanges()
If contents are not equals, a list ofContentComparatorChangeis generated- Returns:
- list of
ContentComparatorChange
-
getContent1
public Content getContent1()
get the 1st content of the comparison- Returns:
- 1st content
-
getContent2
public Content getContent2()
get the 1st content of the comparison- Returns:
- 2nd content
-
getViewName
public String getViewName()
get the name of theView- Returns:
- View's name (can be null)
-
getView
public View getView()
get theView(generated from the view name, of from all attributes)- Returns:
View
-
addChange
protected void addChange(ContentComparatorChange change)
add a change to the list- Parameters:
change- a new change
-
setNotEquals
protected void setNotEquals()
declare that the 2 contents are not equals
-
-