## com.baidubce.services.moladb.model
Class Key

    java.lang.Object
      com.baidubce.services.moladb.model.Key

    public class Key

extends Object

Represents the Key part for an item. For each Key, it maybe an attribute for hashkey or two attributes for hashkey and rangekey.

Constructor Summary
`Key()` Constructs a new Key object.
`Key(Map<String,AttributeValue> attributes)` Constructs a new Key object.
`Key(String attributeName, AttributeValue value)` Constructs a new Key object.
`Key(String hashKeyName, AttributeValue hashKeyValue, String rangeKeyName, AttributeValue rangeKeyValue)` Constructs a new Key object.

Method Summary
`Map<String,AttributeValue>` `getAttributes()` Get this object's attribute map with name and value.
`void` `setAttributes(Map<String,AttributeValue> attributes)` Set this object with a given attribute value map.
`protected Map<String,Object>` `toJsonObj()`
`String` `toString()` Return a string representation of the object.
`Key` `withAttribute(String attributeName, AttributeValue value)` The method set attribute name and attribute value with input parameters for a key.
`Key` `withAttributes(Map<String,AttributeValue> attributes)` Set this object with a given attribute value map.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Key

    public Key()

  Constructs a new Key object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

### Key

    public Key(String attributeName,
               AttributeValue value)

  Constructs a new Key object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

  Parameters:
    `attributeName` - The attribute name to set for a key.
    `value` - The attribute value to set for a key.

### Key

    public Key(String hashKeyName,
               AttributeValue hashKeyValue,
               String rangeKeyName,
               AttributeValue rangeKeyValue)

  Constructs a new Key object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

  Parameters:
    `hashKeyName` - The attribute name to set for a hashKey.
    `hashKeyValue` - The attribute value to set for a hashKey.
    `rangeKeyName` - The attribute name to set for a rangeKey.
    `rangeKeyValue` - The attribute value to set for a rangeKey.

### Key

    public Key(Map<String,AttributeValue> attributes)

  Constructs a new Key object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

  Parameters:
    `attributes` - An attribute map with name and value to set for a key.

Method Detail

### withAttribute

    public Key withAttribute(String attributeName,
                             AttributeValue value)

  The method set attribute name and attribute value with input parameters for a key. Returns a reference to this object so that method calls can be chained together.

  Parameters:
    `attributeName` - The attribute name to set for a key.
    `value` - The attribute value to set for a key.
  Returns:
    A reference to this object so that method calls can be chained together.

### getAttributes

    public Map<String,AttributeValue> getAttributes()

  Get this object's attribute map with name and value.

  Returns:
    A map of attributes with name and value, the type is Map<String, AttributeValue>.

### setAttributes

    public void setAttributes(Map<String,AttributeValue> attributes)

  Set this object with a given attribute value map.

  Parameters:
    `attributes` - An attribute value map to be set for this object.

### withAttributes

    public Key withAttributes(Map<String,AttributeValue> attributes)

  Set this object with a given attribute value map.

  Parameters:
    `attributes` - An attribute value map to be set for this object.
  Returns:
    A reference to this object so that method calls can be chained together.

### toString

    public String toString()

  Return a string representation of the object.

  Overrides:
    `toString` in class `Object`
  Returns:
    A string representation of the object.

### toJsonObj

    protected Map<String,Object> toJsonObj()

Copyright © 2016. All rights reserved.