Class UserAttributeUtil


  • public final class UserAttributeUtil
    extends Object
    User attribute utilities.
    Since:
    12.0.0
    Version:
    $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
    • Method Detail

      • deserializeValueFromString

        public static List<Object> deserializeValueFromString​(String serviceInstanceId,
                                                              String attributeId,
                                                              String value)
        Deserialize a value from a string representation.
        Parameters:
        serviceInstanceId - the service instance identifier.
        attributeId - the user attribute identifier.
        value - the value.
        Returns:
        the deserialized value.
        Since:
        14.0.0
      • deserializeValueFromString

        public static List<Object> deserializeValueFromString​(UserAttribute attribute,
                                                              String value)
        Deserialize a value from a string representation.
        Parameters:
        attribute - the user attribute.
        value - the value.
        Returns:
        the deserialized value.
        Since:
        14.0.0
      • deserializeValueFromArray

        public static List<Object> deserializeValueFromArray​(IMonitorField.DataType dataType,
                                                             org.json.JSONArray arr)
        Deserialize values from a JSON array.
        Parameters:
        dataType - the data type
        arr - the array
        Returns:
        the values
        Since:
        12.0.0
      • getFromJsonString

        public static Object getFromJsonString​(IMonitorField.DataType dataType,
                                               String o)
        Returns a value from a raw JSON value in String.
        Parameters:
        dataType - the data type
        o - the raw JSON value in string.
        Returns:
        the value.
        Since:
        12.3.0
      • serializeValueToString

        public static String serializeValueToString​(String serviceInstanceId,
                                                    String attributeId,
                                                    Collection<Object> value)
        Serializes a value for a given attribute.
        Parameters:
        serviceInstanceId - the service instance identifier
        attributeId - the attribute identifier
        value - the value
        Returns:
        the serialized value
        Since:
        14.0.0
      • serializeValueToString

        public static String serializeValueToString​(UserAttribute attribute,
                                                    Collection<Object> value)
        Serializes a value for a given attribute.
        Parameters:
        attribute - the attribute
        value - the value.
        Returns:
        the serialized value
        Since:
        14.0.0
      • serializeValueToArray

        public static org.json.JSONArray serializeValueToArray​(IMonitorField.DataType dataType,
                                                               Collection<Object> value)
        Serializes a value to a JSON array.
        Parameters:
        dataType - the data type
        value - the value
        Returns:
        the JSON array
        Since:
        12.0.0
      • convertToJsonObject

        public static Object convertToJsonObject​(IMonitorField.DataType dataType,
                                                 Object o)
        Returns the JSON raw object version for the given object.
        Parameters:
        dataType - the data type
        o - the object
        Returns:
        the raw JSON object version of the given object
        Since:
        12.0.0