Class Tag
- 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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tagclone()booleanequals(Object obj)StringgetKey()The key of the tag.StringgetValue()The value of the tag.inthashCode()voidsetKey(String key)The key of the tag.voidsetValue(String value)The value of the tag.StringtoString()Returns a string representation of this object; useful for testing and debugging.TagwithKey(String key)The key of the tag.TagwithValue(String value)The value of the tag.
-
-
-
Constructor Detail
-
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 Detail
-
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:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-