Class State<T>

java.lang.Object
io.dapr.client.domain.State<T>
Type Parameters:
T - The type of the value of the sate

public class State<T>
extends java.lang.Object
This class reprent what a State is.
  • Constructor Summary

    Constructors 
    Constructor Description
    State​(java.lang.String key, java.lang.String etag, StateOptions options)
    Create an inmutable state This Constructor MUST be used anytime you need to retrieve or delete a State.
    State​(T value, java.lang.String key, java.lang.String etag, StateOptions options)
    Create an inmutable state.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    java.lang.String getEtag()
    Retrieve the ETag of this state.
    java.lang.String getKey()
    Retrieves the Key of the state.
    StateOptions getOptions()
    Retrieve the Options used for saving the state.
    T getValue()
    Retrieves the Value of the state.
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • State

      public State​(java.lang.String key, java.lang.String etag, StateOptions options)
      Create an inmutable state This Constructor MUST be used anytime you need to retrieve or delete a State.
      Parameters:
      key - - The key of the state
      etag - - The etag of the state - Keep in mind that for some state stores (like redis) only numbers are supported.
      options - - REQUIRED when saving a state.
    • State

      public State​(T value, java.lang.String key, java.lang.String etag, StateOptions options)
      Create an inmutable state. This Constructor MUST be used anytime you want the state to be send for a Save operation.
      Parameters:
      value - - The value of the state.
      key - - The key of the state.
      etag - - The etag of the state - Keep in mind that for some state stores (like redis) only numbers are supported.
      options - - REQUIRED when saving a state.
  • Method Details

    • getValue

      public T getValue()
      Retrieves the Value of the state.
      Returns:
      The value of the state
    • getKey

      public java.lang.String getKey()
      Retrieves the Key of the state.
      Returns:
      The key of the state
    • getEtag

      public java.lang.String getEtag()
      Retrieve the ETag of this state.
      Returns:
      The etag of the state
    • getOptions

      public StateOptions getOptions()
      Retrieve the Options used for saving the state.
      Returns:
      The options to save the state
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object