Class UserCustomAttributesMap<T>

  • All Implemented Interfaces:
    Map<String,​List<Object>>

    public class UserCustomAttributesMap<T>
    extends AbstractMap<String,​T>
    Custom map implementation for storing user attribute values. Designed to be used by MonitorUser and UserConfig.
    Since:
    11.0.0
    Version:
    $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
    • Constructor Detail

      • UserCustomAttributesMap

        public UserCustomAttributesMap​(String serviceInstaceId,
                                       Map<String,​T> storage,
                                       UserCustomAttributesMap.EntityFactory<T> attributeEntityFactory,
                                       java.util.function.Function<T,​String> attributeEntityReader,
                                       Runnable modificationCallback)
        Creates a new map that reflects view and changes on the given map transforming the values with the given functions.
        Parameters:
        serviceInstaceId - the service instance identifier group attributes.
        storage - the underlying map.
        attributeEntityFactory - function that returns a new attribute entity instance for a attribute identifier and string value pair.
        attributeEntityReader - function that returns the string value from a attribute entity instance.
        modificationCallback - function called when this map is modified (element added, updated or removed).
        Since:
        14.0.0
    • Method Detail

      • transformedToStored

        protected T transformedToStored​(String attributeId,
                                        List<Object> value)
        Converts a data value to the attribute entity instance.
        Parameters:
        attributeId - the attribute identifier.
        value - the value with type according to the attribute data type.
        Returns:
        the attribute entity instance.
        Since:
        12.0.0
      • storedToTransformed

        protected List<Object> storedToTransformed​(String attributeId,
                                                   T attributeEntity)
        Converts an attribute entity instance to the value according to its data type.
        Parameters:
        attributeId - the attribute identifier.
        attributeEntity - the attribute entity instance.
        Returns:
        the value.
        Since:
        12.0.0