Class FeatureField
- java.lang.Object
-
- de.hybris.platform.core.FlexibleSearchTranslatable
-
- de.hybris.platform.core.GenericField
-
- de.hybris.platform.core.GenericSearchField
-
- de.hybris.platform.catalog.jalo.classification.util.FeatureField
-
- All Implemented Interfaces:
java.io.Serializable
public class FeatureField extends GenericSearchField
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FeatureField(ClassAttributeAssignment assignment, java.lang.String producttypeAlias, Language lang, boolean enumsAsPos, boolean isValueSelect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectableValue(int position, ClassificationAttributeValue selValue)For enum features: Since operations which require value order are limited to the configured selctable values it is necessary to add unconfigured values manually if they should be comparable within the query.protected booleanenumsAsPos()ClassAttributeAssignmentgetClassAttributeAssignment()TypedFeature.FeatureTypegetFeatureType()LanguagegetLanguage()java.lang.StringgetProductTypeAlias()java.util.List<ClassificationAttributeValue>getSelectableValues()For enum features: Returns all configured selectable value.ClassificationAttributeUnitgetUnit()Returns the unit of the queried feature.booleanisCaseInsensitive()Tells whether or not string comparation should be done case insensitively.voidsetCaseInsensitive(boolean insensitive)Changes whether or not string comparation should be done case insensitively.voidsetLanguage(Language lang)For localized features only: Allows to specify the value language explicitely - otherwise the session language would have been used.voidsetProductTypeAlias(java.lang.String alias)Allows to specify the alias of the product type within the enclosing query.voidsetSelectRawValue(boolean selectRaw)voidsetUnit(ClassificationAttributeUnit unit)For features with existing unit only: Changes the target unit of this condition.voidtoFlexibleSearch(java.lang.StringBuilder query, java.util.Map<java.lang.String,java.lang.String> typeIndexMap, java.util.Map<java.lang.String,java.lang.Object> valueMap)compiles this instance in order to append its query snippet and add its value(s), if anyprotected voidwriteConditions(java.lang.StringBuilder query, java.util.Map<java.lang.String,java.lang.String> typeIndexMap, java.util.Map<java.lang.String,java.lang.Object> valueMap)protected voidwriteValueField(java.lang.StringBuilder query, java.util.Map<java.lang.String,java.lang.Object> valueMap)-
Methods inherited from class de.hybris.platform.core.GenericSearchField
addFieldType, equals, getFieldTypes, getLanguagePK, hasFieldType, hashCode, isTranslatableToPolyglotDialect, setFieldTypes, setLanguagePK, toPolyglotSearch, toString
-
Methods inherited from class de.hybris.platform.core.GenericField
getQualifier, getTypeCode, getTypeIdentifier, setQualifier, setTypeIdentifier
-
Methods inherited from class de.hybris.platform.core.FlexibleSearchTranslatable
getAliasFromTypeMap
-
-
-
-
Constructor Detail
-
FeatureField
public FeatureField(ClassAttributeAssignment assignment, java.lang.String producttypeAlias, Language lang, boolean enumsAsPos, boolean isValueSelect)
-
-
Method Detail
-
setSelectRawValue
public void setSelectRawValue(boolean selectRaw)
-
getFeatureType
public TypedFeature.FeatureType getFeatureType()
-
getSelectableValues
public java.util.List<ClassificationAttributeValue> getSelectableValues()
For enum features: Returns all configured selectable value. Operations which require value order are limited to these values (using their position within the list).See
addSelectableValue(int, ClassificationAttributeValue)for how to allow unconfigured values as well.
-
addSelectableValue
public void addSelectableValue(int position, ClassificationAttributeValue selValue)For enum features: Since operations which require value order are limited to the configured selctable values it is necessary to add unconfigured values manually if they should be comparable within the query.- Parameters:
position- the desired position of the unconfigured valueselValue- the unconfigured value
-
getClassAttributeAssignment
public ClassAttributeAssignment getClassAttributeAssignment()
-
getUnit
public ClassificationAttributeUnit getUnit()
Returns the unit of the queried feature. If a unit is present the statement will convert all values of other units into this unit to allow comparation.
-
setUnit
public void setUnit(ClassificationAttributeUnit unit)
For features with existing unit only: Changes the target unit of this condition. Only convertible units of the configured unit are allowed.
-
setLanguage
public void setLanguage(Language lang)
For localized features only: Allows to specify the value language explicitely - otherwise the session language would have been used.
-
getLanguage
public Language getLanguage()
-
setProductTypeAlias
public void setProductTypeAlias(java.lang.String alias)
Allows to specify the alias of the product type within the enclosing query.This is always necessary when the product type is not the initial type of the enclosing query!
-
getProductTypeAlias
public java.lang.String getProductTypeAlias()
-
isCaseInsensitive
public boolean isCaseInsensitive()
Tells whether or not string comparation should be done case insensitively.
-
setCaseInsensitive
public void setCaseInsensitive(boolean insensitive)
Changes whether or not string comparation should be done case insensitively.
-
enumsAsPos
protected boolean enumsAsPos()
-
writeValueField
protected void writeValueField(java.lang.StringBuilder query, java.util.Map<java.lang.String,java.lang.Object> valueMap)
-
writeConditions
protected void writeConditions(java.lang.StringBuilder query, java.util.Map<java.lang.String,java.lang.String> typeIndexMap, java.util.Map<java.lang.String,java.lang.Object> valueMap)
-
toFlexibleSearch
public void toFlexibleSearch(java.lang.StringBuilder query, java.util.Map<java.lang.String,java.lang.String> typeIndexMap, java.util.Map<java.lang.String,java.lang.Object> valueMap)Description copied from class:FlexibleSearchTranslatablecompiles this instance in order to append its query snippet and add its value(s), if any- Overrides:
toFlexibleSearchin classGenericSearchField- Parameters:
query- contains the querytypeIndexMap- contains typeCode <> typeIndex mappingsvalueMap- contains valueQualifier <> value mappings- See Also:
FlexibleSearchTranslatable.toFlexibleSearch(java.lang.StringBuilder, Map, Map)
-
-