类 KeySchemaElement
- java.lang.Object
-
- 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.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringHASH_KEY_TYPEstatic StringRANGE_KEY_TYPE
-
构造器概要
构造器 构造器 说明 KeySchemaElement()Constructs a new KeySchemaElement object.KeySchemaElement(String attributeName, String keyType)Constructs a new KeySchemaElement object.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetAttributeName()Get the attribute name for the key schema.StringgetKeyType()Get the key type for the key schema.voidsetAttributeName(String name)Set the attribute name for the key schema.voidsetKeyType(String type)Set the key type for the key schema.protected ObjecttoJsonObj()StringtoString()Return a string representation of the object.KeySchemaElementwithAttributeName(String name)Set the attribute name for the key schema.KeySchemaElementwithKeyType(String type)Set the key type for the key schema.
-
-
-
构造器详细资料
-
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.- 参数:
attributeName- The attribute name for a key.keyType- The type of the key, it is hashKey or rangeKey.
-
-
方法详细资料
-
setAttributeName
public void setAttributeName(String name)
Set the attribute name for the key schema.- 参数:
name- The attribute name for a key to be set.
-
withAttributeName
public KeySchemaElement withAttributeName(String name)
Set the attribute name for the key schema.- 参数:
name- The attribute name for a key to be set.- 返回:
- 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.- 返回:
- The attribute name for a key.
-
setKeyType
public void setKeyType(String type)
Set the key type for the key schema.- 参数:
type- The key type name for the key schema.- 抛出:
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.- 参数:
type- The key type name for the key schema.- 返回:
- 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.- 返回:
- The key type name for the key schema.
-
toJsonObj
protected Object toJsonObj()
-
-