Class LocalizedValue
- java.lang.Object
-
- de.hybris.platform.integrationservices.item.LocalizedValue
-
public class LocalizedValue extends java.lang.ObjectA value object for localized attributes. This object captures values for possible different locales the attributes may be set to.
-
-
Field Summary
Fields Modifier and Type Field Description static LocalizedValueEMPTYAn empty localized value that does not contain any localized values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalizedValuecombine(LocalizedValue value)Sets all values available in the specifiedLocalizedValue.LocalizedValuecombine(java.util.Locale locale, java.lang.String value)Sets value for a specific locale.booleanequals(java.lang.Object o)java.lang.Stringget(java.util.Locale locale)Reads back a value set for the specified locale.inthashCode()static LocalizedValueof(java.util.Locale locale, java.lang.String value)Creates instance with a single localized value set for the specified locale.java.lang.StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final LocalizedValue EMPTY
An empty localized value that does not contain any localized values.
-
-
Method Detail
-
of
public static LocalizedValue of(java.util.Locale locale, java.lang.String value)
Creates instance with a single localized value set for the specified locale.- Parameters:
locale- non-null value specifying in what locale the value is.value- a locale specific value.- Returns:
- new instance with the value set.
- Throws:
java.lang.IllegalArgumentException- iflocaleis null
-
get
public java.lang.String get(java.util.Locale locale)
Reads back a value set for the specified locale.- Parameters:
locale- a locale to read the value for.- Returns:
- a value last set for the locale or
null, if a value for the specified locale has never been set yet. - See Also:
combine(Locale, String)
-
combine
public LocalizedValue combine(java.util.Locale locale, java.lang.String value)
Sets value for a specific locale. Keep in mind this method does not mutate this localized value, therefore to see the change the returned object must be used.- Parameters:
locale- a locale to set the value for.value- a value for the specified locale.- Returns:
- a new instance of the
LocalizedValue, which contains the value for the specified locale - Throws:
java.lang.IllegalArgumentException- iflocaleis null
-
combine
public LocalizedValue combine(LocalizedValue value)
Sets all values available in the specifiedLocalizedValue. Keep in mind this method does not mutate this localized value, therefore to see the change the returned object must be used.- Parameters:
value- a value to be combined with thisLocalizedValue.- Returns:
- a new instance of the
LocalizedValue, which contains all localized values from this and and the specifiedLocalizedValue
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-