com.baidubce.services.moladb.model
Class KeysAndAttributes

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

public class KeysAndAttributes
extends Object

Represents a set of keys and, for each key, the attributes to retrieve from the table.


Constructor Summary
KeysAndAttributes()
          Constructs a new KeysAndAttributes object.
 
Method Summary
 List<String> getAttributesToGet()
          Get all of the attributes to retrieve from a table.
 List<Key> getKeys()
          Get the key attributes the define the items and the attributes associated with the items in this object.
 boolean isConsistentRead()
          Return true if the consistency is a strongly consistent read; else return false.
 void setAttributesToGet(List<String> attributes)
          Attributes to retrieve from the table.
 void setConsistentRead(boolean consistentRead)
          Set the type of the consistency of a read operation.The default value is false, representing that it is eventually consistent read.
 void setKeys(List<Key> keys)
          Set the list of Keys to get associated items.
protected  Map<String,Object> toJsonObj()
           
 String toString()
          Return a string representation of the object.
 KeysAndAttributes withAttributesToGet(List<String> attributes)
          Attributes to retrieve from the table.
 KeysAndAttributes withConsistentRead(boolean consistentRead)
          Set the type of the consistency of a read operation.The default value is false, representing that it is eventually consistent read.
 KeysAndAttributes withKeys(List<Key> keys)
          Set the list of Keys to get associated items.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeysAndAttributes

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

Method Detail

withKeys

public KeysAndAttributes withKeys(List<Key> keys)
Set the list of Keys to get associated items.

Parameters:
keys - The key attributes and values to get items from a table.
Returns:
Returns a reference to this object so that method calls can be chained together.

setKeys

public void setKeys(List<Key> keys)
Set the list of Keys to get associated items.

Parameters:
keys - The key attributes and values to get items from a table.
Throws:
IllegalArgumentException - if the list is empty.

setConsistentRead

public void setConsistentRead(boolean consistentRead)
Set the type of the consistency of a read operation.The default value is false, representing that it is eventually consistent read. If the value is true, it is a strongly consistent read.

Parameters:
consistentRead - The consistency of a read operation. The default value is false, representing that it is eventually consistent read. If the value is true, it is a strongly consistent read.

withConsistentRead

public KeysAndAttributes withConsistentRead(boolean consistentRead)
Set the type of the consistency of a read operation.The default value is false, representing that it is eventually consistent read. If the value is true, it is a strongly consistent read.

Parameters:
consistentRead - The consistency of a read operation. The default value is false, representing that it is eventually consistent read. If the value is true, it is a strongly consistent read.
Returns:
Returns a reference to this object so that method calls can be chained together.

withAttributesToGet

public KeysAndAttributes withAttributesToGet(List<String> attributes)
Attributes to retrieve from the table.

Parameters:
attributes - The attributes to retrieve from an item.
Returns:
Returns a reference to this object so that method calls can be chained together.

setAttributesToGet

public void setAttributesToGet(List<String> attributes)
Attributes to retrieve from the table.

Parameters:
attributes - The attributes to retrieve from an item.

toJsonObj

protected Map<String,Object> toJsonObj()

isConsistentRead

public boolean isConsistentRead()
Return true if the consistency is a strongly consistent read; else return false.

Returns:
The consistency of a read operation.The default value is false, representing that it is eventually consistent read. If the value is true, it is a strongly consistent read.

getAttributesToGet

public List<String> getAttributesToGet()
Get all of the attributes to retrieve from a table.

Returns:
All of the attributes to retrieve from a table.

getKeys

public List<Key> getKeys()
Get the key attributes the define the items and the attributes associated with the items in this object.

Returns:
A list of Key with key attributes and theirs attribute values.

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.