Class LocalizedValue
java.lang.Object
de.hybris.platform.integrationservices.item.LocalizedValue
A value object for localized attributes. This object captures values for possible different locales the attributes may be set to.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LocalizedValueAn empty localized value that does not contain any localized values. -
Method Summary
Modifier and TypeMethodDescriptioncombine(LocalizedValue value) Sets all values available in the specifiedLocalizedValue.Sets value for a specific locale.booleanvoidforEach(BiConsumer<Locale, Object> consumer) Applies theconsumeroperation to eachLocaleand valueReads back a value set for the specified locale.inthashCode()static LocalizedValueCreates instance with a single localized value set for the specified locale.toString()
-
Field Details
-
EMPTY
An empty localized value that does not contain any localized values.
-
-
Method Details
-
of
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 nullable locale specific value.- Returns:
- new instance with the value set.
- Throws:
IllegalArgumentException- iflocaleis null
-
get
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:
-
forEach
Applies theconsumeroperation to eachLocaleand value- Parameters:
consumer- Consumes the Locale and value
-
combine
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:
IllegalArgumentException- iflocaleis null
-
combine
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
-
hashCode
public int hashCode() -
toString
-