com.baidubce.services.moladb.model
Class KeySchemaElement

java.lang.Object
  extended by com.baidubce.services.moladb.model.KeySchemaElement

public class KeySchemaElement
extends Object

Represents the key schema for a table. A key schema can be a hashkey, or a hashkey and a rangekey. For a hashkey or a rangekey, there is an attribute name and corresponding attribute value for it.


Field Summary
static String HASH_KEY_TYPE
           
static String RANGE_KEY_TYPE
           
 
Constructor Summary
KeySchemaElement()
          Constructs a new KeySchemaElement object.
KeySchemaElement(String attributeName, String keyType)
          Constructs a new KeySchemaElement object.
 
Method Summary
 String getAttributeName()
          Get the attribute name for the key schema.
 String getKeyType()
          Get the key type for the key schema.
 void setAttributeName(String name)
          Set the attribute name for the key schema.
 void setKeyType(String type)
          Set the key type for the key schema.
protected  Object toJsonObj()
           
 String toString()
          Return a string representation of the object.
 KeySchemaElement withAttributeName(String name)
          Set the attribute name for the key schema.
 KeySchemaElement withKeyType(String type)
          Set the key type for the key schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HASH_KEY_TYPE

public static final String HASH_KEY_TYPE
See Also:
Constant Field Values

RANGE_KEY_TYPE

public static final String RANGE_KEY_TYPE
See Also:
Constant Field Values
Constructor Detail

KeySchemaElement

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


KeySchemaElement

public KeySchemaElement(String attributeName,
                        String keyType)
Constructs a new KeySchemaElement object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
attributeName - The attribute name for a key.
keyType - The type of the key, it is hashKey or rangeKey.
Method Detail

setAttributeName

public void setAttributeName(String name)
Set the attribute name for the key schema.

Parameters:
name - The attribute name for a key to be set.

withAttributeName

public KeySchemaElement withAttributeName(String name)
Set the attribute name for the key schema.

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

getAttributeName

public String getAttributeName()
Get the attribute name for the key schema.

Returns:
The attribute name for a key.

setKeyType

public void setKeyType(String type)
Set the key type for the key schema.

Parameters:
type - The key type name for the key schema.
Throws:
IllegalArgumentException - if the key type is not HASH_KEY_TYPE or RANGE_KEY_TYPE.

withKeyType

public KeySchemaElement withKeyType(String type)
Set the key type for the key schema.

Parameters:
type - The key type name for the key schema.
Returns:
Returns a reference to this object so that method calls can be chained together.

getKeyType

public String getKeyType()
Get the key type for the key schema.

Returns:
The key type name for the key schema.

toJsonObj

protected Object toJsonObj()

toString

public String toString()
Return a string representation of the object.

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


Copyright © 2018. All rights reserved.