Class SuggesterGroupDescriptor
java.lang.Object
org.nuxeo.ecm.platform.suggestbox.service.descriptors.SuggesterGroupDescriptor
- All Implemented Interfaces:
Descriptor
-
Field Summary
FieldsFields inherited from interface org.nuxeo.runtime.model.Descriptor
UNIQUE_DESCRIPTOR_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanappend(SuggesterGroupDescriptor merged, 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 static booleanappendAfter(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName) Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust after the suggester namedsuggesterNamein the#suggesterslist.protected static booleanappendBefore(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName) Unless a suggester namednewSuggesterNamealready exists in the#suggesterslist, appends a newSuggesterGroupItemDescriptornamednewSuggesterNamejust before the suggester namedsuggesterNamein the#suggesterslist.getId()The descriptor id, descriptors with same id are merged.getName()protected static intindexOf(SuggesterGroupDescriptor merged, 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.merge(Descriptor o) Returns a descriptor representingothermerged intothisprotected static booleanremove(SuggesterGroupDescriptor merged, String suggesterName) Removes the suggester namedsuggesterNamefrom the#suggesterslist.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Descriptor
doesRemove
-
Field Details
-
name
-
suggesters
-
-
Constructor Details
-
SuggesterGroupDescriptor
public SuggesterGroupDescriptor()
-
-
Method Details
-
getId
Description copied from interface:DescriptorThe descriptor id, descriptors with same id are merged.To forbid multiple descriptors use UNIQUE_DESCRIPTOR_ID.
To forbid merge use a unique value, non-overriden
toString()for exemple.- Specified by:
getIdin interfaceDescriptor
-
getName
-
getSuggesters
-
merge
Description copied from interface:DescriptorReturns a descriptor representingothermerged intothisDefault implementation returns
other.- Specified by:
mergein interfaceDescriptor- Returns:
- the merged descriptor
-
remove
Removes the suggester namedsuggesterNamefrom the#suggesterslist.- Parameters:
merged- the descriptor to merged intosuggesterName- the suggester name- Returns:
- true, if a suggester was removed
-
indexOf
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:
merged- the descriptor to merged intosuggesterName- 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 static boolean appendBefore(SuggesterGroupDescriptor merged, 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:
merged- the descriptor to merged intosuggesterName- the suggester namenewSuggesterName- the name of the suggester to append- Returns:
- true, if the suggester named
newSuggesterNamewas appended to the#suggesterslist
-
appendAfter
protected static boolean appendAfter(SuggesterGroupDescriptor merged, 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:
merged- the descriptor to merged intosuggesterName- the suggester namenewSuggesterName- the name of the suggester to append- Returns:
- true, if the suggester named
newSuggesterNamewas appended to the#suggesterslist
-
append
protected static boolean append(SuggesterGroupDescriptor merged, 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
Logs that the suggester namednewSuggesterNamealready exists in the#suggesterslist and therefore won't be appended to it.- Parameters:
newSuggesterName- the new suggester name
-