Class ProfileDataCollection.AttributeValue

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    ProfileDataCollection

    public static final class ProfileDataCollection.AttributeValue
    extends Object
    implements Serializable

    Class representing an exported profile attribute value. Objects of this class encapsulate either a java.lang.String object representing an exported value, or an array of AttributeValue objects representing the exported elements of an array-type attribute. Null attribute values and null array elements are exported as null values, rather than as an AttributeValue instance encapsulating a null value.

    See Also:
    Serialized Form
    • Constructor Detail

      • AttributeValue

        public AttributeValue​(String value)

        Create a new attribute value encapsulating an exported value.

        Parameters:
        value - the exported value.
        Throws:
        NullPointerException - if value is null.
    • Method Detail

      • isArray

        public boolean isArray()

        Determine if this object encapsulates an array of elements.

        Returns:
        true if this object encapulates an array of elements, false if a simple string value is encapsulated.
      • isMapping

        public boolean isMapping()

        Determine if this object encapsulates a map of entries.

        Returns:
        true if this object encapsulates a map of entries, false if a simple string value is encapsulated.
      • getValue

        public String getValue()

        Get the simple string value encapsulated by this object. isArray() must return false in order to be able to use this method.

        Returns:
        the exported string value encapsulated by this object.
        Throws:
        IllegalArgumentException - if a string value is not encapsulated by this object.
      • getValues

        public ProfileDataCollection.AttributeValue[] getValues()

        Get the array encapsulated by this object. isArray() must return true in order to be able to use this method.

        Returns:
        the exported array of attribute values encapsulated by this object.
        Throws:
        IllegalArgumentException - if an attribute value array is not encapsulated by this object.
      • hashCode

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

        public String toString()

        Convert the attribute value (and any nested array values) into a human-readable form.

        Overrides:
        toString in class Object
        Returns:
        a string form of the attribute value.