com.amazonaws.services.cloudfront.model

## Class Tag

- java.lang.Object
- - com.amazonaws.services.cloudfront.model.Tag

All Implemented Interfaces:
  Serializable, Cloneable

    public class Tag
    extends Object
    implements Serializable, Cloneable

A complex type that contains `Tag` key and `Tag` value.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Tag()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Tag` `clone()`
`boolean` `equals(Object obj)`
`String` `getKey()` A string that contains `Tag` key.
`String` `getValue()` A string that contains an optional `Tag` value.
`int` `hashCode()`
`void` `setKey(String key)` A string that contains `Tag` key.
`void` `setValue(String value)` A string that contains an optional `Tag` value.
`String` `toString()` Returns a string representation of this object; useful for testing and debugging.
`Tag` `withKey(String key)` A string that contains `Tag` key.
`Tag` `withValue(String value)` A string that contains an optional `Tag` value.

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Tag

    public Tag()

### Method Detail

#### setKey

    public void setKey(String key)

A string that contains `Tag` key.

The string length should be between 1 and 128 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

Parameters:
  `key` - A string that contains `Tag` key.

  The string length should be between 1 and 128 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

#### getKey

    public String getKey()

A string that contains `Tag` key.

The string length should be between 1 and 128 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

Returns:
  A string that contains `Tag` key.

  The string length should be between 1 and 128 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

#### withKey

    public Tag withKey(String key)

A string that contains `Tag` key.

The string length should be between 1 and 128 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

Parameters:
  `key` - A string that contains `Tag` key.

  The string length should be between 1 and 128 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

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

#### setValue

    public void setValue(String value)

A string that contains an optional `Tag` value.

The string length should be between 0 and 256 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

Parameters:
  `value` - A string that contains an optional `Tag` value.

  The string length should be between 0 and 256 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

#### getValue

    public String getValue()

A string that contains an optional `Tag` value.

The string length should be between 0 and 256 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

Returns:
  A string that contains an optional `Tag` value.

  The string length should be between 0 and 256 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

#### withValue

    public Tag withValue(String value)

A string that contains an optional `Tag` value.

The string length should be between 0 and 256 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special characters `_ - . : / = + @`.

Parameters:
  `value` - A string that contains an optional `Tag` value.

  The string length should be between 0 and 256 characters. Valid characters include `a-z`, `A-Z`, `0-9`, space, and the special 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 class `Object`
Returns:
  A string representation of this object.
See Also:
  `Object.toString()`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### clone

    public Tag clone()

Overrides:
  `clone` in class `Object`