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 Tag
clone()
boolean
equals(Object obj)
String
getKey()
The key of the tag.String
getValue()
The value of the tag.int
hashCode()
void
setKey(String key)
The key of the tag.void
setValue(String value)
The value of the tag.String
toString()
Returns a string representation of this object; useful for testing and debugging.Tag
withKey(String key)
The key of the tag.Tag
withValue(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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-