Class MapFieldTypeConverter
- java.lang.Object
-
- com.broadleafcommerce.search.api.service.MapFieldTypeConverter
-
- All Implemented Interfaces:
FieldTypeConverter
public abstract class MapFieldTypeConverter extends Object implements FieldTypeConverter
AFieldTypeConverterwhich stores the field type conversions in a map.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.collections4.BidiMap<String,String>conversionsA bi-directional map to store conversions from generic field types to search-engine-specific implementation field types, and vice versa.
-
Constructor Summary
Constructors Constructor Description MapFieldTypeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFieldType(String fieldType, String implementationFieldTypes)Adds a supported field type.StringconvertFieldType(String fieldType)Convert a generic field type to an implementation specific type.StringretrieveFieldType(String implementationFieldType)Retrieve the generic field type from the implementation specific type.
-
-
-
Method Detail
-
convertFieldType
public String convertFieldType(@Nullable String fieldType)
Description copied from interface:FieldTypeConverterConvert a generic field type to an implementation specific type.Generic field type should match a
FieldType- Specified by:
convertFieldTypein interfaceFieldTypeConverter- Parameters:
fieldType- The generic field type to convert- Returns:
- The implementation specific field type
-
retrieveFieldType
public String retrieveFieldType(@Nullable String implementationFieldType)
Description copied from interface:FieldTypeConverterRetrieve the generic field type from the implementation specific type.Generic field type should match a
FieldType- Specified by:
retrieveFieldTypein interfaceFieldTypeConverter- Parameters:
implementationFieldType- The implementation specific field type- Returns:
- The generic field type
-
addFieldType
protected void addFieldType(@Nullable String fieldType, @Nullable String implementationFieldTypes)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.
-
-