Package de.cxp.ocs.config
Class FieldConfigIndex
- java.lang.Object
-
- de.cxp.ocs.config.FieldConfigIndex
-
- All Implemented Interfaces:
FieldConfigAccess
public final class FieldConfigIndex extends Object implements FieldConfigAccess
Special class that cares about resolving the correct field configuration, especially for "the category field" and dynamic fields.
-
-
Constructor Summary
Constructors Constructor Description FieldConfigIndex(FieldConfiguration fieldConfiguration)Constructor of the Field Index that prepares the given field configurations to match static and dynamic fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Field>getField(String fieldName)Get field by unique field name.Map<String,Field>getFieldsByType(FieldType type)get all fields that have the specified field type configured.Map<String,Field>getFieldsByUsage(FieldUsage usage)Get all fields that have the specified usage configured.Optional<Field>getMatchingField(String fieldName, FieldUsage usage)Get field with that name and the specified usage.Optional<Field>getMatchingField(String fieldName, Object value, FieldUsage usage)/** Similar togetMatchingField(String, Object)but additionally tries to generate a field configuration based on the dynamic fields.Set<Field>getMatchingFields(String fieldName)Get all fields that have the the specified name as field-name or source-field.Set<Field>getMatchingFields(String fieldName, Object value)Similar togetMatchingField(String)but additionally tries to generate a field configuration based on the dynamic fields.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.cxp.ocs.config.FieldConfigAccess
getPrimaryCategoryField
-
-
-
-
Constructor Detail
-
FieldConfigIndex
public FieldConfigIndex(FieldConfiguration fieldConfiguration)
Constructor of the Field Index that prepares the given field configurations to match static and dynamic fields.- Parameters:
fieldConfiguration- full field configuration
-
-
Method Detail
-
getFieldsByUsage
public Map<String,Field> getFieldsByUsage(FieldUsage usage)
Description copied from interface:FieldConfigAccessGet all fields that have the specified usage configured.- Specified by:
getFieldsByUsagein interfaceFieldConfigAccess- Returns:
-
getFieldsByType
public Map<String,Field> getFieldsByType(FieldType type)
Description copied from interface:FieldConfigAccessget all fields that have the specified field type configured.- Specified by:
getFieldsByTypein interfaceFieldConfigAccess- Returns:
-
getField
public Optional<Field> getField(String fieldName)
Get field by unique field name.- Specified by:
getFieldin interfaceFieldConfigAccess- Parameters:
fieldName-- Returns:
-
getMatchingFields
public Set<Field> getMatchingFields(String fieldName)
Get all fields that have the the specified name as field-name or source-field. If source-fields are not given at initialization (such at the search service), this function works similar togetField(String)- Specified by:
getMatchingFieldsin interfaceFieldConfigAccess- Parameters:
fieldName-- Returns:
-
getMatchingField
public Optional<Field> getMatchingField(String fieldName, FieldUsage usage)
Get field with that name and the specified usage.- Specified by:
getMatchingFieldin interfaceFieldConfigAccess- Parameters:
fieldName-usage-- Returns:
-
getMatchingFields
public Set<Field> getMatchingFields(String fieldName, Object value)
Similar togetMatchingField(String)but additionally tries to generate a field configuration based on the dynamic fields. If no dynamic fields are configured (such as at the search-service), no field configs are generated.- Specified by:
getMatchingFieldsin interfaceFieldConfigAccess- Parameters:
fieldName-value-- Returns:
-
getMatchingField
public Optional<Field> getMatchingField(String fieldName, Object value, FieldUsage usage)
/** Similar togetMatchingField(String, Object)but additionally tries to generate a field configuration based on the dynamic fields. Those fields are then filtered by the specifiedFieldUsage.- Parameters:
fieldName-value-usage-- Returns:
-
-