Class MapFieldTypeConverter
java.lang.Object
com.broadleafcommerce.search.api.service.MapFieldTypeConverter
- All Implemented Interfaces:
FieldTypeConverter
A
FieldTypeConverter
which stores the field type conversions in a map.-
Field Summary
Modifier and TypeFieldDescriptionA bi-directional map to store conversions from generic field types to search-engine-specific implementation field types, and vice versa. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFieldType
(String fieldType, String implementationFieldTypes) Adds a supported field type.convertFieldType
(String fieldType) Convert a generic field type to an implementation specific type.retrieveFieldType
(String implementationFieldType) Retrieve the generic field type from the implementation specific type.
-
Field Details
-
conversions
A bi-directional map to store conversions from generic field types to search-engine-specific implementation field types, and vice versa.
-
-
Constructor Details
-
MapFieldTypeConverter
public MapFieldTypeConverter()
-
-
Method Details
-
convertFieldType
Description copied from interface:FieldTypeConverter
Convert a generic field type to an implementation specific type.Generic field type should match a
FieldType
- Specified by:
convertFieldType
in interfaceFieldTypeConverter
- Parameters:
fieldType
- The generic field type to convert- Returns:
- The implementation specific field type
-
retrieveFieldType
Description copied from interface:FieldTypeConverter
Retrieve the generic field type from the implementation specific type.Generic field type should match a
FieldType
- Specified by:
retrieveFieldType
in interfaceFieldTypeConverter
- Parameters:
implementationFieldType
- The implementation specific field type- Returns:
- The generic field type
-
addFieldType
Adds a supported field type.- Parameters:
fieldType
- The field type (e.g. STRING, TEXT, DATE, etc)implementationFieldTypes
- The implementation specific field type.
For Solr users, these are the dynamic field types defined in the schema, e.g. 't', 'l', 'txt', etc.
-