# QueryStateItem (dapr-sdk-parent 1.10.0 API)

Package io.dapr.client.domain

## Class QueryStateItem<T>

- java.lang.Object
- - io.dapr.client.domain.QueryStateItem<T>

    public class QueryStateItem<T>
    extends Object

### Constructor Summary

Constructors
`QueryStateItem​(String key)` Create an immutable state reference to be retrieved or deleted.
`QueryStateItem​(String key, String etag, String error)` Create an immutable state reference to be retrieved or deleted.
`QueryStateItem​(String key, T value, String etag)` Create an immutable state.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals​(Object o)`
`String` `getError()` Retrieve the error for this state.
`String` `getEtag()` Retrieve the ETag of this state.
`String` `getKey()` Retrieves the Key of the state.
`T` `getValue()` Retrieves the Value of the state.
`int` `hashCode()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### QueryStateItem

    public QueryStateItem​(String key)

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

#### QueryStateItem

    public QueryStateItem​(String key,
                          String etag,
                          String error)

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
  `etag` - - The etag of the state - Keep in mind that for some state stores (like redis) only numbers are supported.
  `error` - - Error when fetching the state.

#### QueryStateItem

    public QueryStateItem​(String key,
                          T value,
                          String etag)

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.

### Method Detail

#### getValue

    public T getValue()

Retrieves the Value of the state.

Returns:
  The value of the state

#### getKey

    public String getKey()

Retrieves the Key of the state.

Returns:
  The key of the state

#### getEtag

    public String getEtag()

Retrieve the ETag of this state.

Returns:
  The etag of the state

#### getError

    public String getError()

Retrieve the error for this state.

Returns:
  The error for this state.

#### equals

    public boolean equals​(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`