类 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.
    • 构造器详细资料

      • 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()
      • toString

        public String toString()
        Return a string representation of the object.
        覆盖:
        toString 在类中 Object
        返回:
        A string representation of the object.