public class Tag
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
A key/value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clu\ sters to track your Amazon EMR resource allocation costs. For more information, see Tagging Amazon EMR Resources.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
key
A user-defined key, which is the minimum required information for a valid
tag.
|
private java.lang.String |
value
A user-defined value, which is optional in a tag.
|
Constructor and Description |
---|
Tag()
Default constructor for Tag object.
|
Tag(java.lang.String key,
java.lang.String value)
Constructs a new Tag object.
|
Modifier and Type | Method and Description |
---|---|
Tag |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getKey()
A user-defined key, which is the minimum required information for a valid
tag.
|
java.lang.String |
getValue()
A user-defined value, which is optional in a tag.
|
int |
hashCode() |
void |
setKey(java.lang.String key)
A user-defined key, which is the minimum required information for a valid
tag.
|
void |
setValue(java.lang.String value)
A user-defined value, which is optional in a tag.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Tag |
withKey(java.lang.String key)
A user-defined key, which is the minimum required information for a valid
tag.
|
Tag |
withValue(java.lang.String value)
A user-defined value, which is optional in a tag.
|
private java.lang.String key
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tagging Amazon EMR Resources.
private java.lang.String value
A user-defined value, which is optional in a tag. For more information, see Tagging Amazon EMR Resources.
public Tag()
public Tag(java.lang.String key, java.lang.String value)
key
- A user-defined key, which is the minimum required information for
a valid tag. For more information, see Tagging Amazon EMR Resources.value
- A user-defined value, which is optional in a tag. For more
information, see Tagging Amazon EMR Resources.public void setKey(java.lang.String key)
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tagging Amazon EMR Resources.
key
- A user-defined key, which is the minimum required information for
a valid tag. For more information, see Tagging Amazon EMR Resources.public java.lang.String getKey()
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tagging Amazon EMR Resources.
public Tag withKey(java.lang.String key)
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tagging Amazon EMR Resources.
key
- A user-defined key, which is the minimum required information for
a valid tag. For more information, see Tagging Amazon EMR Resources.public void setValue(java.lang.String value)
A user-defined value, which is optional in a tag. For more information, see Tagging Amazon EMR Resources.
value
- A user-defined value, which is optional in a tag. For more
information, see Tagging Amazon EMR Resources.public java.lang.String getValue()
A user-defined value, which is optional in a tag. For more information, see Tagging Amazon EMR Resources.
public Tag withValue(java.lang.String value)
A user-defined value, which is optional in a tag. For more information, see Tagging Amazon EMR Resources.
value
- A user-defined value, which is optional in a tag. For more
information, see Tagging Amazon EMR Resources.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Tag clone()
clone
in class java.lang.Object