Package com.azure.core.util.polling
Class PollingContext<T>
- java.lang.Object
-
- com.azure.core.util.polling.PollingContext<T>
-
- Type Parameters:
T- the type of the poll response.
public final class PollingContext<T> extends Object
A key/value store that is propagated between various poll related operations associated withPollerFluxandSyncPollerpoller. The context also expose activation and latestPollResponse.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PollResponse<T>getActivationResponse()StringgetData(String name)Get a value from the context with the provided key.PollResponse<T>getLatestResponse()PollingContext<T>setData(String name, String value)Set a key-value pair in the context.
-
-
-
Method Detail
-
getData
public String getData(String name)
Get a value from the context with the provided key.- Parameters:
name- the key to look for- Returns:
- the value of the key if exists, else null
-
setData
public PollingContext<T> setData(String name, String value)
Set a key-value pair in the context.- Parameters:
name- the keyvalue- the value- Returns:
- an updated PollingContext
-
getActivationResponse
public PollResponse<T> getActivationResponse()
- Returns:
- the activation
PollResponseholding result of activation operation call.
-
getLatestResponse
public PollResponse<T> getLatestResponse()
- Returns:
- the latest
PollResponsefrom pollOperation.
-
-