Class LocalizedAttributes


  • public class LocalizedAttributes
    extends java.lang.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 Detail

      • EMPTY

        public static final LocalizedAttributes EMPTY
        An empty LocalizedAttributes object 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 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​(java.util.Map<java.lang.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​(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 is null
        java.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 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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object