Package io.dapr.client.domain
Class State<T>
java.lang.Object
io.dapr.client.domain.State<T>
- Type Parameters:
T
- The type of the value of the sate
This class reprent what a State is.
-
Constructor Summary
ConstructorDescriptionCreate an immutable state reference to be retrieved or deleted.Create an immutable state.State
(String key, String etag, StateOptions options) Create an immutable state reference to be retrieved or deleted.Create an immutable state.State
(String key, T value, String etag, StateOptions options) Create an immutable state.Create an immutable state. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getError()
Retrieve the error for this state.getEtag()
Retrieve the ETag of this state.getKey()
Retrieves the Key of the state.Retrieve the metadata of this state.Retrieve the Options used for saving the state.getValue()
Retrieves the Value of the state.int
hashCode()
toString()
-
Constructor Details
-
State
Create an immutable state reference to be retrieved or deleted. This Constructor CAN be used anytime you need to retrieve or delete a state.- Parameters:
key
- - The key of the state
-
State
Create an immutable state reference to be retrieved or deleted. This Constructor CAN be used anytime you need to retrieve or delete a state.- Parameters:
key
- - The key of the stateetag
- - 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
Create an immutable state. This Constructor CAN be used anytime you want the state to be saved.- Parameters:
key
- - The key of the state.value
- - The value of the state.etag
- - The etag of the state - for some state stores (like redis) only numbers are supported.options
- - REQUIRED when saving a state.
-
State
Create an immutable state. This Constructor CAN be used anytime you want the state to be saved.- Parameters:
key
- - The key of the state.value
- - The value of the state.etag
- - The etag of the state - for some state stores (like redis) only numbers are supported.metadata
- - The metadata of the state.options
- - REQUIRED when saving a state.
-
State
Create an immutable state. This Constructor CAN be used anytime you want the state to be saved.- Parameters:
key
- - The key of the state.value
- - The value of the state.etag
- - The etag of the state - some state stores (like redis) only numbers are supported.
-
State
Create an immutable state. This Constructor MUST be used anytime the key could not be retrieved and contains an error.- Parameters:
key
- - The key of the state.error
- - Error when fetching the state.
-
-
Method Details
-
getValue
Retrieves the Value of the state.- Returns:
- The value of the state
-
getKey
Retrieves the Key of the state.- Returns:
- The key of the state
-
getEtag
Retrieve the ETag of this state.- Returns:
- The etag of the state
-
getMetadata
Retrieve the metadata of this state.- Returns:
- the metadata of this state
-
getError
Retrieve the error for this state.- Returns:
- The error for this state.
-
getOptions
Retrieve the Options used for saving the state.- Returns:
- The options to save the state
-
equals
-
hashCode
public int hashCode() -
toString
-