Package io.goobi.viewer.model.search
Class SearchQueryGroup
java.lang.Object
io.goobi.viewer.model.search.SearchQueryGroup
- All Implemented Interfaces:
Serializable
Searches query group for the advanced search.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerates the logical operators used to combine multipleSearchQueryItems within a group. -
Constructor Summary
ConstructorsConstructorDescriptionSearchQueryGroup(List<AdvancedSearchFieldConfiguration> fieldConfigs, String template) Creates a new SearchQueryGroup instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNewQueryItem(String field, int afterIndex) addNewQueryItem.getAvailableOperators.Getter for the fieldoperator.Getter for the fieldqueryItems.voidinit(List<AdvancedSearchFieldConfiguration> fieldConfigs, String template) voidinjectItems(List<SearchQueryItem> items) Replaces query items in this group with the given list.booleanisBlank()booleanremoveQueryItem.voidResets all items.voidSetter for the fieldoperator.
-
Constructor Details
-
SearchQueryGroup
Creates a new SearchQueryGroup instance.- Parameters:
fieldConfigs- list of advanced search field configurationstemplate- search template name to use for initialization
-
-
Method Details
-
init
- Parameters:
fieldConfigs- list of advanced search field configurationstemplate- search template name to determine available fields
-
injectItems
Replaces query items in this group with the given list.- Parameters:
items- list of search query items to inject
-
resetItems
public void resetItems()Resets all items. -
isBlank
public boolean isBlank()- Returns:
- true if none of the items has any value input; false otherwise
-
getAvailableOperators
getAvailableOperators.- Returns:
- a list of all available search query group operators
-
getQueryItems
Getter for the fieldqueryItems.- Returns:
- the list of individual search query items within this group
-
addNewQueryItem
addNewQueryItem.- Parameters:
field- Index field for the new itemafterIndex- Item index after which to place new new item- Returns:
- true if operation successful; false otherwise
-
removeQueryItem
removeQueryItem.- Parameters:
item- aSearchQueryItemobject.- Returns:
- true if the item was removed successfully, false if it could not be removed (e.g. it is the last remaining item)
-
getOperator
Getter for the fieldoperator.- Returns:
- the logical operator (AND/OR) used to combine items within this query group
-
setOperator
Setter for the fieldoperator.- Parameters:
operator- the logical operator (AND/OR) used to combine items within this query group
-