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 boolean
append
(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName, boolean before) Unless a suggester namednewSuggesterName
already exists in the#suggesters
list, appends a newSuggesterGroupItemDescriptor
namednewSuggesterName
just before (ifbefore
is true) or after the suggester namedsuggesterName
in the#suggesters
list.protected static boolean
appendAfter
(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName) Unless a suggester namednewSuggesterName
already exists in the#suggesters
list, appends a newSuggesterGroupItemDescriptor
namednewSuggesterName
just after the suggester namedsuggesterName
in the#suggesters
list.protected static boolean
appendBefore
(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName) Unless a suggester namednewSuggesterName
already exists in the#suggesters
list, appends a newSuggesterGroupItemDescriptor
namednewSuggesterName
just before the suggester namedsuggesterName
in the#suggesters
list.getId()
The descriptor id, descriptors with same id are merged.getName()
protected static int
indexOf
(SuggesterGroupDescriptor merged, String suggesterName) Returns the index of the first occurrence of the element namedsuggesterName
in the#suggesters
list, or -1 ifsuggesterName
is null or if this list does not contain the element.protected void
logExistingSuggesterName
(String newSuggesterName) Logs that the suggester namednewSuggesterName
already exists in the#suggesters
list and therefore won't be appended to it.merge
(Descriptor o) Returns a descriptor representingother
merged intothis
protected static boolean
remove
(SuggesterGroupDescriptor merged, String suggesterName) Removes the suggester namedsuggesterName
from the#suggesters
list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Descriptor
The 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:
getId
in interfaceDescriptor
-
getName
-
getSuggesters
-
merge
Description copied from interface:Descriptor
Returns a descriptor representingother
merged intothis
Default implementation returns
other
.- Specified by:
merge
in interfaceDescriptor
- Returns:
- the merged descriptor
-
remove
Removes the suggester namedsuggesterName
from the#suggesters
list.- 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 namedsuggesterName
in the#suggesters
list, or -1 ifsuggesterName
is 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
suggesterName
in the#suggesters
list, or -1 ifsuggesterName
is null or if this list does not contain the element
-
appendBefore
protected static boolean appendBefore(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName) Unless a suggester namednewSuggesterName
already exists in the#suggesters
list, appends a newSuggesterGroupItemDescriptor
namednewSuggesterName
just before the suggester namedsuggesterName
in the#suggesters
list. If the suggester namedsuggesterName
does 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
newSuggesterName
was appended to the#suggesters
list
-
appendAfter
protected static boolean appendAfter(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName) Unless a suggester namednewSuggesterName
already exists in the#suggesters
list, appends a newSuggesterGroupItemDescriptor
namednewSuggesterName
just after the suggester namedsuggesterName
in the#suggesters
list. If the suggester namedsuggesterName
does 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
newSuggesterName
was appended to the#suggesters
list
-
append
protected static boolean append(SuggesterGroupDescriptor merged, String suggesterName, String newSuggesterName, boolean before) Unless a suggester namednewSuggesterName
already exists in the#suggesters
list, appends a newSuggesterGroupItemDescriptor
namednewSuggesterName
just before (ifbefore
is true) or after the suggester namedsuggesterName
in the#suggesters
list. If the suggester namedsuggesterName
does 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
newSuggesterName
was appended to the#suggesters
list
-
logExistingSuggesterName
Logs that the suggester namednewSuggesterName
already exists in the#suggesters
list and therefore won't be appended to it.- Parameters:
newSuggesterName
- the new suggester name
-