@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Tag extends Object implements Serializable, Cloneable, StructuredPojo
Adds metadata, in the form of a key:value pair, to the specified resource.
For example, you could add the tag Department:Sales to a resource to indicate that it pertains to your
organization's sales department. You can also use tags for tag-based access control.
To learn more about tagging, see Tagging resources.
| Constructor and Description |
|---|
Tag() |
| Modifier and Type | Method and Description |
|---|---|
Tag |
clone() |
boolean |
equals(Object obj) |
String |
getKey()
The first part of a key:value pair that forms a tag associated with a given resource.
|
String |
getValue()
The second part of a key:value pair that forms a tag associated with a given resource.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller) |
void |
setKey(String key)
The first part of a key:value pair that forms a tag associated with a given resource.
|
void |
setValue(String value)
The second part of a key:value pair that forms a tag associated with a given resource.
|
String |
toString()
Returns a string representation of this object.
|
Tag |
withKey(String key)
The first part of a key:value pair that forms a tag associated with a given resource.
|
Tag |
withValue(String value)
The second part of a key:value pair that forms a tag associated with a given resource.
|
public void setKey(String key)
The first part of a key:value pair that forms a tag associated with a given resource. For example, in the tag
Department:Sales, the key is 'Department'.
key - The first part of a key:value pair that forms a tag associated with a given resource. For example, in the
tag Department:Sales, the key is 'Department'.public String getKey()
The first part of a key:value pair that forms a tag associated with a given resource. For example, in the tag
Department:Sales, the key is 'Department'.
Department:Sales, the key is 'Department'.public Tag withKey(String key)
The first part of a key:value pair that forms a tag associated with a given resource. For example, in the tag
Department:Sales, the key is 'Department'.
key - The first part of a key:value pair that forms a tag associated with a given resource. For example, in the
tag Department:Sales, the key is 'Department'.public void setValue(String value)
The second part of a key:value pair that forms a tag associated with a given resource. For example, in the tag
Department:Sales, the value is 'Sales'.
Note that you can set the value of a tag to an empty string, but you can't set the value of a tag to null. Omitting the tag value is the same as using an empty string.
value - The second part of a key:value pair that forms a tag associated with a given resource. For example, in the
tag Department:Sales, the value is 'Sales'.
Note that you can set the value of a tag to an empty string, but you can't set the value of a tag to null. Omitting the tag value is the same as using an empty string.
public String getValue()
The second part of a key:value pair that forms a tag associated with a given resource. For example, in the tag
Department:Sales, the value is 'Sales'.
Note that you can set the value of a tag to an empty string, but you can't set the value of a tag to null. Omitting the tag value is the same as using an empty string.
Department:Sales, the value is 'Sales'.
Note that you can set the value of a tag to an empty string, but you can't set the value of a tag to null. Omitting the tag value is the same as using an empty string.
public Tag withValue(String value)
The second part of a key:value pair that forms a tag associated with a given resource. For example, in the tag
Department:Sales, the value is 'Sales'.
Note that you can set the value of a tag to an empty string, but you can't set the value of a tag to null. Omitting the tag value is the same as using an empty string.
value - The second part of a key:value pair that forms a tag associated with a given resource. For example, in the
tag Department:Sales, the value is 'Sales'.
Note that you can set the value of a tag to an empty string, but you can't set the value of a tag to null. Omitting the tag value is the same as using an empty string.
public String toString()
toString in class ObjectObject.toString()public void marshall(ProtocolMarshaller protocolMarshaller)
marshall in interface StructuredPojoCopyright © 2023. All rights reserved.