Class Key

  • All Implemented Interfaces:

    @Serializable() 
    public final class Key
    
                        

    Object's Key class, used for identifying VMware Aria Operation Objects.

    Objects are identified by the Adapter Type, Object Type, and one or more Identifiers.

    Identifiers can be either the Object's name, or one or more Identifier key-value pairs. In order for an 'Identifier' to be used for identification, it must have isPartOfUniqueness set to true (this is the default).

    Two Objects with the same Key are not permitted in a CollectResult.

    Objects must be created with the full key. Keys cannot change after the Object has been created.

    All Objects with the same Adapter Type and Object Type must have the same set of Identifiers.

    • Method Detail

      • getName

         final String getName()

        A human-readable name for this Object. Should be unique if possible.

      • getIdentifiers

         final List<Identifier> getIdentifiers()

        A list of Identifiers that uniquely identify the Object. If none are present than the name must be unique and is used for identification. All Objects with the same adapter type and Object type must have the same set of identifiers.

      • equals

         Boolean equals(Object other)
        Returns:

        True if the keys will resolve to the same object, false otherwise.

      • hashCode

         Integer hashCode()

        Return a hashcode of this Key, respecting the rules of key uniqueness

      • getIdentifier

        @JvmOverloads() final String getIdentifier(String key, String defaultValue)

        Return the value for the given identifier key.

        Parameters:
        key - The identifier key.
        defaultValue - An optional default value.
        Returns:

        The value associated with the identifier. If the value associated with the identifier is empty and 'defaultValue' is provided, returns 'defaultValue'. If the identifier does not exist, returns defaultValue if provided, else 'null'.

      • getIdentifier

        @JvmOverloads() final String getIdentifier(String key)

        Return the value for the given identifier key.

        Parameters:
        key - The identifier key.
        Returns:

        The value associated with the identifier. If the value associated with the identifier is empty and 'defaultValue' is provided, returns 'defaultValue'. If the identifier does not exist, returns defaultValue if provided, else 'null'.