Share via


Contexts Class

  • java.lang.Object
    • com.azure.core.util.Contexts

public final class Contexts

A utility type that can be used to add and retrieve instances commonly used in Context.

Method Summary

Modifier and Type Method and Description
static Contexts empty()

Creates Contexts from empty Context.

Context getContext()

Returns a version of the Context reflecting mutations.

ProgressReporter getHttpRequestProgressReporter()

Retrieves request's ProgressReporter from the Context.

Contexts setHttpRequestProgressReporter(ProgressReporter progressReporter)

Adds request's ProgressReporter instance to the Context.

static Contexts with(Context context)

Creates Contexts from supplied Context.

Methods inherited from java.lang.Object

Method Details

empty

public static Contexts empty()

Creates Contexts from empty Context.

Returns:

The Contexts instance.

getContext

public Context getContext()

Returns a version of the Context reflecting mutations.

Returns:

The version of the Context reflecting mutations.

getHttpRequestProgressReporter

public ProgressReporter getHttpRequestProgressReporter()

Retrieves request's ProgressReporter from the Context.

Returns:

setHttpRequestProgressReporter

public Contexts setHttpRequestProgressReporter(ProgressReporter progressReporter)

Adds request's ProgressReporter instance to the Context.

Parameters:

progressReporter - The ProgressReporter instance.

Returns:

Itself.

with

public static Contexts with(Context context)

Creates Contexts from supplied Context.

Parameters:

context - Existing Context. Must not be null.

Returns:

The Contexts instance.

Applies to