Enum EC2MetadataKeys

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<EC2MetadataKeys>

    public enum EC2MetadataKeys
    extends java.lang.Enum<EC2MetadataKeys>
    A enum of Amazon EC2 metadata.
    Since:
    1.0
    • Field Detail

      • AWS_METADATA_URL

        public static final java.lang.String AWS_METADATA_URL
        See Also:
        Constant Field Values
      • path

        protected java.lang.String path
    • Method Detail

      • values

        public static EC2MetadataKeys[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EC2MetadataKeys c : EC2MetadataKeys.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EC2MetadataKeys valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getName

        public java.lang.String getName()
        Returns:
        The name of key
      • getURL

        public java.net.URL getURL​(java.lang.String prepend,
                                   java.lang.String append)
                            throws java.net.MalformedURLException
        The URL for metadata information. Override to apply prepend and append.
        Parameters:
        prepend - Building the URL endpoints
        append - Region
        Returns:
        The URL for the Metadata information of specific Enum.name().
        Throws:
        java.net.MalformedURLException - If the URL is invalid
      • toString

        public java.lang.String toString()
        Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum type should override this method when a more "programmer-friendly" string form exists.
        Overrides:
        toString in class java.lang.Enum<EC2MetadataKeys>
        Returns:
        the name of this enum constant