Class LocalizedAttributes
- java.lang.Object
-
- de.hybris.platform.odata2services.converter.LocalizedAttributes
-
public class LocalizedAttributes extends java.lang.ObjectLocalized 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
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,LocalizedValue>attributesstatic LocalizedAttributesEMPTYAn emptyLocalizedAttributesobject that does not contain a single attribute value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalizedAttributescombine(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(java.util.Map<java.lang.String,LocalizedValue> values)Creates instance ofLocalizedAttributesand populates it with the provided attribute valuesbooleanequals(java.lang.Object o)voidforEachAttribute(java.util.function.BiConsumer<? super java.lang.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()LocalizedAttributessetAll(LocalizedValue value)Resets all localized attributes to the provided value without mutating thisLocalizedAttributesinstance.java.lang.StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final LocalizedAttributes EMPTY
An emptyLocalizedAttributesobject that does not contain a single attribute value.
-
attributes
protected final java.util.Map<java.lang.String,LocalizedValue> attributes
-
-
Method Detail
-
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
public static LocalizedAttributes createWithValues(java.util.Map<java.lang.String,LocalizedValue> values)
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
public void forEachAttribute(java.util.function.BiConsumer<? super java.lang.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. 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:
java.lang.NullPointerException- if the specified action isnulljava.util.ConcurrentModificationException- if an entry is found to be removed during iteration
-
combine
public LocalizedAttributes combine(LocalizedAttributes another)
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
public LocalizedAttributes setAll(LocalizedValue value)
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
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
-
-