Class LocalizedFeature
- java.lang.Object
-
- de.hybris.platform.classification.features.Feature
-
- de.hybris.platform.classification.features.LocalizedFeature
-
public class LocalizedFeature extends Feature
Localized feature contains collection of values for each language. Note that all methods for setting, getting and clearing values which do not haveLocaleparameter will operate on current data locale.
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.classification.features.Feature
assignment, code, name
-
-
Constructor Summary
Constructors Constructor Description LocalizedFeature(ClassAttributeAssignmentModel assignment, java.util.Map<java.util.Locale,java.util.List<FeatureValue>> values, java.util.Locale currentLocale)Instantiates a new localized typed feature.LocalizedFeature(java.lang.String code, java.util.Map<java.util.Locale,java.util.List<FeatureValue>> values, java.util.Locale currentLocale)Instantiates a new localized untyped feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(int index, FeatureValue fvalue)Inserts theFeatureValueat the specified index position in this list (optional operation).voidaddValue(int index, FeatureValue fvalue, java.util.Locale locale)voidaddValue(FeatureValue fvalue)Add to this feature aFeatureValuevoidaddValue(FeatureValue fvalue, java.util.Locale locale)FeatureValuegetValue()Convenience method to return a single value.FeatureValuegetValue(java.util.Locale locale)java.util.List<FeatureValue>getValues()Returns the list of feature values.java.util.List<FeatureValue>getValues(java.util.Locale locale)Gets the list of feature values for particular locale.java.util.Map<java.util.Locale,java.util.List<FeatureValue>>getValuesForAllLocales()Gets the whole map of values where key isLocaleand value list of feature values.voidremoveAllValues()Remove all containingFeatureValues from the current feature.voidremoveAllValues(java.util.Locale locale)booleanremoveValue(FeatureValue fvalue)Removes the first occurrence of the givenFeatureValuefrom the feature, if it is present (optional operation).booleanremoveValue(FeatureValue fvalue, java.util.Locale locale)voidsetValues(java.util.List<FeatureValue> fvalues)Clears always allFeatureValueof this Feature and add the given List with FeatureValues to this Feature.voidsetValues(java.util.List<FeatureValue> fvalues, java.util.Locale locale)-
Methods inherited from class de.hybris.platform.classification.features.Feature
getClassAttributeAssignment, getCode, getName, toString
-
-
-
-
Constructor Detail
-
LocalizedFeature
public LocalizedFeature(ClassAttributeAssignmentModel assignment, java.util.Map<java.util.Locale,java.util.List<FeatureValue>> values, java.util.Locale currentLocale)
Instantiates a new localized typed feature.- Parameters:
assignment- the assignmentvalues- the valuescurrentLocale- the current locale
-
LocalizedFeature
public LocalizedFeature(java.lang.String code, java.util.Map<java.util.Locale,java.util.List<FeatureValue>> values, java.util.Locale currentLocale)Instantiates a new localized untyped feature.- Parameters:
code- the codevalues- the valuescurrentLocale- the current locale
-
-
Method Detail
-
getValuesForAllLocales
public java.util.Map<java.util.Locale,java.util.List<FeatureValue>> getValuesForAllLocales()
Gets the whole map of values where key isLocaleand value list of feature values.- Returns:
- the values
-
getValues
public java.util.List<FeatureValue> getValues(java.util.Locale locale)
Gets the list of feature values for particular locale.- Parameters:
locale- the locale- Returns:
- the values
-
getValues
public java.util.List<FeatureValue> getValues()
Description copied from class:FeatureReturns the list of feature values. The list is unmodifiable.
-
getValue
public FeatureValue getValue()
Description copied from class:FeatureConvenience method to return a single value. If the value list is empty this method will return null. If the list's size is greater that one it will return the first element.
-
getValue
public FeatureValue getValue(java.util.Locale locale)
-
addValue
public void addValue(FeatureValue fvalue)
Description copied from class:FeatureAdd to this feature aFeatureValue
-
addValue
public void addValue(FeatureValue fvalue, java.util.Locale locale)
-
addValue
public void addValue(int index, FeatureValue fvalue)Description copied from class:FeatureInserts theFeatureValueat the specified index position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
-
addValue
public void addValue(int index, FeatureValue fvalue, java.util.Locale locale)
-
removeValue
public boolean removeValue(FeatureValue fvalue)
Description copied from class:FeatureRemoves the first occurrence of the givenFeatureValuefrom the feature, if it is present (optional operation). If thisUnlocalizedFeaturedoes not contain thisFeatureValue, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists). Returns true if the feature contained the specified feature value.- Specified by:
removeValuein classFeature- Parameters:
fvalue- the FeatureValue to be removed- Returns:
- true if the feature value was removed successfully
-
removeValue
public boolean removeValue(FeatureValue fvalue, java.util.Locale locale)
-
removeAllValues
public void removeAllValues()
Description copied from class:FeatureRemove all containingFeatureValues from the current feature.- Specified by:
removeAllValuesin classFeature
-
removeAllValues
public void removeAllValues(java.util.Locale locale)
-
setValues
public void setValues(java.util.List<FeatureValue> fvalues)
Description copied from class:FeatureClears always allFeatureValueof this Feature and add the given List with FeatureValues to this Feature. If the parameter is null the internal FeatureValue List will only be cleared (same behaviour asFeature.removeAllValues()
-
setValues
public void setValues(java.util.List<FeatureValue> fvalues, java.util.Locale locale)
-
-