Class SuggesterGroupDescriptor
- java.lang.Object
-
- org.nuxeo.ecm.platform.suggestbox.service.descriptors.SuggesterGroupDescriptor
-
-
Constructor Summary
Constructors Constructor Description SuggesterGroupDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanappend(String suggesterName, String newSuggesterName, boolean before)Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust before (ifbeforeis true) or after the suggester namedsuggesterNamein the#suggesterslist.protected booleanappendAfter(String suggesterName, String newSuggesterName)Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust after the suggester namedsuggesterNamein the#suggesterslist.protected booleanappendBefore(String suggesterName, String newSuggesterName)Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust before the suggester namedsuggesterNamein the#suggesterslist.Objectclone()StringgetName()List<SuggesterGroupItemDescriptor>getSuggesters()protected intindexOf(String suggesterName)Returns the index of the first occurrence of the element namedsuggesterNamein the#suggesterslist, or -1 ifsuggesterNameis null or if this list does not contain the element.protected voidlogExistingSuggesterName(String newSuggesterName)Logs that the suggester namednewSuggesterNamealready exists in the#suggesterslist and therefore won't be appended to it.voidmergeFrom(SuggesterGroupDescriptor newDescriptor)protected booleanremove(String suggesterName)Removes the suggester namedsuggesterNamefrom the#suggesterslist.
-
-
-
Field Detail
-
name
protected String name
-
-
Method Detail
-
getName
public String getName()
-
getSuggesters
public List<SuggesterGroupItemDescriptor> getSuggesters()
-
mergeFrom
public void mergeFrom(SuggesterGroupDescriptor newDescriptor) throws ComponentInitializationException
- Throws:
ComponentInitializationException
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
remove
protected boolean remove(String suggesterName)
Removes the suggester namedsuggesterNamefrom the#suggesterslist.- Parameters:
suggesterName- the suggester name- Returns:
- true, if a suggester was removed
-
indexOf
protected int indexOf(String suggesterName)
Returns the index of the first occurrence of the element namedsuggesterNamein the#suggesterslist, or -1 ifsuggesterNameis null or if this list does not contain the element.- Parameters:
suggesterName- the suggester name- Returns:
- the index of the first occurrence of the element named
suggesterNamein the#suggesterslist, or -1 ifsuggesterNameis null or if this list does not contain the element
-
appendBefore
protected boolean appendBefore(String suggesterName, String newSuggesterName)
Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust before the suggester namedsuggesterNamein the#suggesterslist. If the suggester namedsuggesterNamedoes not exist, appends the new suggester at the beginning of the list.- Parameters:
suggesterName- the suggester namenewSuggesterName- the name of the suggester to append- Returns:
- true, if the suggester named
newSuggesterNamewas appended to the#suggesterslist
-
appendAfter
protected boolean appendAfter(String suggesterName, String newSuggesterName)
Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust after the suggester namedsuggesterNamein the#suggesterslist. If the suggester namedsuggesterNamedoes not exist, appends the new suggester at the end of the list.- Parameters:
suggesterName- the suggester namenewSuggesterName- the name of the suggester to append- Returns:
- true, if the suggester named
newSuggesterNamewas appended to the#suggesterslist
-
append
protected boolean append(String suggesterName, String newSuggesterName, boolean before)
Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust before (ifbeforeis true) or after the suggester namedsuggesterNamein the#suggesterslist. If the suggester namedsuggesterNamedoes not exist, appends the new suggester at the beginning or the end of the list, depending onbefore.- Parameters:
suggesterName- the suggester namenewSuggesterName- the name of the suggester to append- Returns:
- true, if the suggester named
newSuggesterNamewas appended to the#suggesterslist
-
logExistingSuggesterName
protected void logExistingSuggesterName(String newSuggesterName)
Logs that the suggester namednewSuggesterNamealready exists in the#suggesterslist and therefore won't be appended to it.- Parameters:
newSuggesterName- the new suggester name
-
-