Class DataAPIStatus

java.lang.Object
com.datastax.astra.internal.api.DataAPIStatus

public class DataAPIStatus extends Object
Status of the Data API.
  • Field Details

    • payload

      public transient Map<String,Object> payload
      Default properties.
  • Constructor Details

    • DataAPIStatus

      public DataAPIStatus()
      Default constructor.
  • Method Details

    • getInsertedIds

      public <T> List<T> getInsertedIds(Class<T> clazz)
      Access the insertedIds mapping.
      Type Parameters:
      T - list of class
      Parameters:
      clazz - current
      Returns:
      list of inserteds ids
    • getPayload

      public Map<String,Object> getPayload()
      Getter for the payload.
      Returns:
      the payload
    • setProperty

      public void setProperty(String key, Object value)
      Add a property to the payload.
      Parameters:
      key - property name
      value - property value
    • containsKey

      public boolean containsKey(Object key)
      Check if the payload contains a key.
      Parameters:
      key - the key
      Returns:
      true if the key is present
    • getInteger

      public Integer getInteger(String key)
      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

      public Boolean getBoolean(String key)
      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

      public <T> T get(@NonNull @NonNull String key, @NonNull @NonNull Class<T> clazz)
      Gets the value of the given key, casting it to the given Class<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 write String name = doc.get("name", String.class) instead of String name = (String) doc.get("x") .
      Type Parameters:
      T - the type of the class
      Parameters:
      key - the key
      clazz - 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

      public Object get(Object key)
      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 write String name = doc.get("name") instead of String 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.