com.amazonaws.services.ec2.model
Class Tag

java.lang.Object
  extended by com.amazonaws.services.ec2.model.Tag

public class Tag
extends Object

Represents metadata to associate with Amazon EC2 resources. Each tag consists of a user-defined key and value. Use tags to categorize EC2 resources, such as by purpose, owner, or environment.


Constructor Summary
Tag()
          Default constructor for a new Tag object.
Tag(String key)
          Constructs a new Tag object.
Tag(String key, String value)
          Constructs a new Tag object.
 
Method Summary
 boolean equals(Object obj)
           
 String getKey()
          The tag's key.
 String getValue()
          The tag's value.
 int hashCode()
           
 void setKey(String key)
          The tag's key.
 void setValue(String value)
          The tag's value.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 Tag withKey(String key)
          The tag's key.
 Tag withValue(String value)
          The tag's value.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

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


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 tag's key.
value - The tag's value.

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 tag's key.
Method Detail

getKey

public String getKey()
The tag's key.

Returns:
The tag's key.

setKey

public void setKey(String key)
The tag's key.

Parameters:
key - The tag's key.

withKey

public Tag withKey(String key)
The tag's key.

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

Parameters:
key - The tag's key.
Returns:
A reference to this updated object so that method calls can be chained together.

getValue

public String getValue()
The tag's value.

Returns:
The tag's value.

setValue

public void setValue(String value)
The tag's value.

Parameters:
value - The tag's value.

withValue

public Tag withValue(String value)
The tag's value.

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

Parameters:
value - The tag's value.
Returns:
A reference to this updated 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:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.