Package com.datastax.astra.internal.api
Class DataAPIStatus
java.lang.Object
com.datastax.astra.internal.api.DataAPIStatus
Status of the Data API.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(Object key) Check if the payload contains a key.<T> T
Gets the value of the given key, casting it to the givenClass<T>
.Gets the value of the given key.getBoolean
(String key) Gets the value of the given key as a Boolean.<T> List
<T> getInsertedIds
(Class<T> clazz) Access the insertedIds mapping.getInteger
(String key) Gets the value of the given key as an Integer.Getter for the payload.Gets the value of the given key as an Integer.void
setProperty
(String key, Object value) Add a property to the payload.
-
Field Details
-
payload
Default properties.
-
-
Constructor Details
-
DataAPIStatus
public DataAPIStatus()Default constructor.
-
-
Method Details
-
getInsertedIds
Access the insertedIds mapping.- Type Parameters:
T
- list of class- Parameters:
clazz
- current- Returns:
- list of inserteds ids
-
getPayload
Getter for the payload.- Returns:
- the payload
-
setProperty
Add a property to the payload.- Parameters:
key
- property namevalue
- property value
-
containsKey
Check if the payload contains a key.- Parameters:
key
- the key- Returns:
- true if the key is present
-
getInteger
Gets the value of the given key as an Integer.- Parameters:
key
- the key- Returns:
- the value as an integer, which may be null
- Throws:
ClassCastException
- if the value is not an integer
-
getString
Gets the value of the given key as an Integer.- Parameters:
key
- the key- Returns:
- the value as an integer, which may be null
- Throws:
ClassCastException
- if the value is not an integer
-
getBoolean
Gets the value of the given key as a Boolean.- Parameters:
key
- the key- Returns:
- the value as a Boolean, which may be null
- Throws:
ClassCastException
- if the value is not a boolean
-
get
Gets the value of the given key, casting it to the givenClass<T>
. This is useful to avoid having casts in client code, though the effect is the same. So to get the value of a key that is of type String, you would writeString name = doc.get("name", String.class)
instead ofString name = (String) doc.get("x")
.- Type Parameters:
T
- the type of the class- Parameters:
key
- the keyclazz
- the non-null class to cast the value to- Returns:
- the value of the given key, or null if the instance does not contain this key.
- Throws:
ClassCastException
- if the value of the given key is not of type T
-
get
Gets the value of the given key. This is useful to avoid having casts in client code, though the effect is the same. So to get the value of a key that is of type String, you would writeString name = doc.get("name")
instead ofString name = (String) doc.get("x")
.- Parameters:
key
- the key- Returns:
- the value of the given key, or null if the instance does not contain this key.
-