Class LocalizedAttributes

java.lang.Object
de.hybris.platform.odata2services.converter.LocalizedAttributes

public class LocalizedAttributes extends Object
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 Details

  • Method Details

    • createFrom

      public static LocalizedAttributes createFrom(org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)
      Creates instance of LocalizedAttributes and 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(Map<String,LocalizedValue> values)
      Creates instance of LocalizedAttributes and 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(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. 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 is null
      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 of LocalizedAttributes
      Parameters:
      another - an instance to combine with
      Returns:
      an instance of LocalizedAttributes that contains all attributes of this instance and all attributes of the provided another instance. If another instance 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 this LocalizedAttributes instance.
      Parameters:
      value - localized value to set in all localized attributes
      Returns:
      new instance of the LocalizedAttributes with all attributes reset to the provided value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object