Class DiffRequest
- java.lang.Object
-
- com.gentics.contentnode.rest.model.request.DiffRequest
-
public class DiffRequest extends Object
Class representing a diff request sent to DiffResource. Encapsulates request data.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
changeTemplate
Template for rendering changesprotected String
content1
First content to be diff'edprotected String
content2
Second content to be diff'edstatic String
DEFAULT_CHANGE_TEMPLATE
Default template for changesstatic String
DEFAULT_INSERT_TEMPLATE
Default template for insertsstatic String
DEFAULT_REMOVE_TEMPALTE
Default template for removalsstatic int
DEFAULT_WORDS_AFTER
Default number of words after the change to be shownstatic int
DEFAULT_WORDS_BEFORE
Default number of words before the change to be shownprotected String
ignoreRegex
Regex of content to be ignored while diffingprotected String
insertTemplate
Template for rendering insertsprotected String
removeTemplate
Template for rendering removalsprotected Integer
wordsAfter
Number of words to be shown after the diffprotected Integer
wordsBefore
Number of words to be shown before the diff
-
Constructor Summary
Constructors Constructor Description DiffRequest()
Create an empty instance (Used by JAXB)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getChangeTemplate()
Return the change template.String
getContent1()
Return the content1.String
getContent2()
Return the content2.String
getIgnoreRegex()
Return the ignore regex that will be used to sanitize the content before the diff is invoked.String
getInsertTemplate()
Return the insert template.String
getRemoveTemplate()
Return the remove template.Integer
getWordsAfter()
Return the amount of words that should be displayed after the actual diff.Integer
getWordsBefore()
Return the number of words before the change to be shown.void
setChangeTemplate(String changeTemplate)
Set the change template.void
setContent1(String content1)
Set the content1.void
setContent2(String content2)
Set the content2.void
setIgnoreRegex(String ignoreRegex)
Set the ignore regex that will be used to sanitize the content before the diff is invoked.void
setInsertTemplate(String insertTemplate)
Set the insert template for the diff request.void
setRemoveTemplate(String removeTemplate)
Set the remove template.void
setWordsAfter(Integer wordsAfter)
Set the amount of words that should be displayed after the actual diff.void
setWordsBefore(Integer wordsBefore)
Set the amount of words that should be displayed before the actual diff.
-
-
-
Field Detail
-
DEFAULT_CHANGE_TEMPLATE
public static final String DEFAULT_CHANGE_TEMPLATE
Default template for changes- See Also:
- Constant Field Values
-
DEFAULT_INSERT_TEMPLATE
public static final String DEFAULT_INSERT_TEMPLATE
Default template for inserts- See Also:
- Constant Field Values
-
DEFAULT_REMOVE_TEMPALTE
public static final String DEFAULT_REMOVE_TEMPALTE
Default template for removals- See Also:
- Constant Field Values
-
DEFAULT_WORDS_BEFORE
public static final int DEFAULT_WORDS_BEFORE
Default number of words before the change to be shown- See Also:
- Constant Field Values
-
DEFAULT_WORDS_AFTER
public static final int DEFAULT_WORDS_AFTER
Default number of words after the change to be shown- See Also:
- Constant Field Values
-
content1
protected String content1
First content to be diff'ed
-
content2
protected String content2
Second content to be diff'ed
-
ignoreRegex
protected String ignoreRegex
Regex of content to be ignored while diffing
-
changeTemplate
protected String changeTemplate
Template for rendering changes
-
insertTemplate
protected String insertTemplate
Template for rendering inserts
-
removeTemplate
protected String removeTemplate
Template for rendering removals
-
wordsBefore
protected Integer wordsBefore
Number of words to be shown before the diff
-
wordsAfter
protected Integer wordsAfter
Number of words to be shown after the diff
-
-
Method Detail
-
getContent1
public String getContent1()
Return the content1.- Returns:
- the content1
-
setContent1
public void setContent1(String content1)
Set the content1.- Parameters:
content1
- the content1 to set
-
getContent2
public String getContent2()
Return the content2.- Returns:
- the content2
-
setContent2
public void setContent2(String content2)
Set the content2.- Parameters:
content2
- the content2 to set
-
getIgnoreRegex
public String getIgnoreRegex()
Return the ignore regex that will be used to sanitize the content before the diff is invoked.- Returns:
- the ignoreRegex
-
setIgnoreRegex
public void setIgnoreRegex(String ignoreRegex)
Set the ignore regex that will be used to sanitize the content before the diff is invoked.- Parameters:
ignoreRegex
- the ignoreRegex to set
-
getChangeTemplate
public String getChangeTemplate()
Return the change template.The following default template will be used when no template has been set: <del class='diff modified gtx-diff'>$remove</del><ins class='diff modified gtx-diff'>$insert</ins>
- Returns:
- the changeTemplate
-
setChangeTemplate
public void setChangeTemplate(String changeTemplate)
Set the change template.The following default template will be used when no template has been set:
<del class='diff modified gtx-diff'>$remove</del><ins class='diff modified gtx-diff'>$insert</ins>
- Parameters:
changeTemplate
- the template to set
-
getInsertTemplate
public String getInsertTemplate()
Return the insert template.The following default template will be used when no template has been set: <ins class='diff modified gtx-diff'>$insert</ins>
- Returns:
- the insertTemplate
-
setInsertTemplate
public void setInsertTemplate(String insertTemplate)
Set the insert template for the diff request.The following default template will be used when no template has been set:
<ins class='diff modified gtx-diff'>$insert</ins>
- Parameters:
insertTemplate
- the template to set
-
getRemoveTemplate
public String getRemoveTemplate()
Return the remove template.The following default template will be used when no template has been set:
<del class='diff modified gtx-diff'>$remove</del>
- Returns:
- the removeTemplate
-
setRemoveTemplate
public void setRemoveTemplate(String removeTemplate)
Set the remove template.The following default template will be used when no template has been set:
<del class='diff modified gtx-diff'>$remove</del>
- Parameters:
removeTemplate
- the removeTemplate to set
-
getWordsBefore
public Integer getWordsBefore()
Return the number of words before the change to be shown. Default value: 10- Returns:
- the wordsBefore
-
setWordsBefore
public void setWordsBefore(Integer wordsBefore)
Set the amount of words that should be displayed before the actual diff. Default value: 10- Parameters:
wordsBefore
- the wordsBefore to set
-
getWordsAfter
public Integer getWordsAfter()
Return the amount of words that should be displayed after the actual diff. Default value: 10- Returns:
- the wordsAfter
-
-