Stay organized with collections Save and categorize content based on your preferences.

public static final class ContextParams.Builder
extends Object



Builder for creating a ContextParams.

Summary

Public constructors

Builder()

Create a new builder.

Builder(ContextParams params)

Create a new builder that inherits all sub-parameters by default.

Public methods

ContextParams build()

Creates a new instance.

ContextParams.Builder setAttributionTag(String attributionTag)

Sets an attribution tag against which to track permission accesses.

ContextParams.Builder setNextAttributionSource(AttributionSource next)

Sets the attribution source for the app on whose behalf you are doing the work.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

public Builder ()

Create a new builder.

This is valuable when you are interested in having explicit control over every sub-parameter, and don't want to inherit any values from an existing Context.

Developers should strongly consider using Builder(android.content.ContextParams) instead of this constructor, since that will will automatically inherit any new sub-parameters added in future platform releases.

Builder

public Builder (ContextParams params)

Create a new builder that inherits all sub-parameters by default.

This is valuable when you are only interested in overriding specific sub-parameters, and want to preserve all other parameters. Setting a specific sub-parameter on the returned builder will override any inherited value.

Parameters
params ContextParams: This value cannot be null.

Public methods

build

public ContextParams build ()

Creates a new instance.

Returns
ContextParams The new instance. This value cannot be null.

setAttributionTag

public ContextParams.Builder setAttributionTag (String attributionTag)

Sets an attribution tag against which to track permission accesses.

Parameters
attributionTag String: The attribution tag. This value may be null.
Returns
ContextParams.Builder This builder. This value cannot be null.

setNextAttributionSource

public ContextParams.Builder setNextAttributionSource (AttributionSource next)

Sets the attribution source for the app on whose behalf you are doing the work.

Parameters
next AttributionSource: The permission identity of the receiving app. This value may be null.
Returns
ContextParams.Builder This builder. This value cannot be null.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2023-02-08 UTC.