java.lang.Object
com.amazonaws.services.ec2.model.Tag
All Implemented Interfaces:
Serializable, Cloneable

public class Tag extends Object implements Serializable, Cloneable

Describes a tag.

See Also:
  • Constructor Details

    • Tag

      public Tag()
      Default constructor for Tag object. Callers should use the setter or fluent setter (with...) methods to initialize the object after creating it.
    • Tag

      public Tag(String key)
      Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      Parameters:
      key - The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

    • Tag

      public Tag(String key, String value)
      Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      Parameters:
      key - The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

      value - The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

  • Method Details

    • setKey

      public void setKey(String key)

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

      Parameters:
      key - The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

    • getKey

      public String getKey()

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

      Returns:
      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

    • withKey

      public Tag withKey(String key)

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

      Parameters:
      key - The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setValue

      public void setValue(String value)

      The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      Parameters:
      value - The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

    • getValue

      public String getValue()

      The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      Returns:
      The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

    • withValue

      public Tag withValue(String value)

      The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      Parameters:
      value - The value of the tag.

      Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public Tag clone()
      Overrides:
      clone in class Object