Class LocalizedAttributes
java.lang.Object
de.hybris.platform.odata2services.converter.LocalizedAttributes
Localized attributes values for a given EDM type. For example, if a Product has localized attributes, then the localized attributes
will be captured in a Localized___Product EDM type. This class represents the Localized___... EDM types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,LocalizedValue> static final LocalizedAttributesAn emptyLocalizedAttributesobject that does not contain a single attribute value. -
Method Summary
Modifier and TypeMethodDescriptioncombine(LocalizedAttributes another) Combines this localized attributes with the attributes present in the other instance ofLocalizedAttributesstatic LocalizedAttributescreateFrom(org.apache.olingo.odata2.api.ep.entry.ODataEntry entry) Creates instance ofLocalizedAttributesand populates it from the provided OData entrystatic LocalizedAttributescreateWithValues(Map<String, LocalizedValue> values) Creates instance ofLocalizedAttributesand populates it with the provided attribute valuesbooleanvoidforEachAttribute(BiConsumer<? super String, ? super LocalizedValue> action) Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.inthashCode()setAll(LocalizedValue value) Resets all localized attributes to the provided value without mutating thisLocalizedAttributesinstance.toString()
-
Field Details
-
EMPTY
An emptyLocalizedAttributesobject that does not contain a single attribute value. -
attributes
-
-
Method Details
-
createFrom
public static LocalizedAttributes createFrom(org.apache.olingo.odata2.api.ep.entry.ODataEntry entry) Creates instance ofLocalizedAttributesand populates it from the provided OData entry- Parameters:
entry- an entry that corresponds to the 'Localized___...' type.- Returns:
- an instance with all localized attributes present in the OData entry
-
createWithValues
Creates instance ofLocalizedAttributesand populates it with the provided attribute values- Parameters:
values- a Map containing localized attribute values.- Returns:
- an instance with provided localized attributes values
-
forEachAttribute
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. Actions are performed in the order of entry set iteration. Exceptions thrown by the action are relayed back to the caller.- Parameters:
action- The action to be performed for each entry- Throws:
NullPointerException- if the specified action isnullConcurrentModificationException- if an entry is found to be removed during iteration
-
combine
Combines this localized attributes with the attributes present in the other instance ofLocalizedAttributes- Parameters:
another- an instance to combine with- Returns:
- an instance of
LocalizedAttributesthat contains all attributes of this instance and all attributes of the providedanotherinstance. Ifanotherinstance contains values for the same attributes as in this instance those values will be preferred to the values in this instance.
-
setAll
Resets all localized attributes to the provided value without mutating thisLocalizedAttributesinstance.- Parameters:
value- localized value to set in all localized attributes- Returns:
- new instance of the
LocalizedAttributeswith all attributes reset to the provided value
-
equals
-
hashCode
public int hashCode() -
toString
-