DeletionRequest.Builder


public static final class DeletionRequest.Builder
extends Object

java.lang.Object
   ↳ android.adservices.measurement.DeletionRequest.Builder


Builder for DeletionRequest objects.

Summary

Public constructors

Builder()

Public methods

DeletionRequest build()

Builds a DeletionRequest instance.

DeletionRequest.Builder setDeletionMode(int deletionMode)

Set the match behavior for the supplied params.

DeletionRequest.Builder setDomainUris(List<Uri> domainUris)

Set the list of domain URI which will be used for matching.

DeletionRequest.Builder setEnd(Instant end)

Set the end of the deletion range.

DeletionRequest.Builder setMatchBehavior(int matchBehavior)

Set the match behavior for the supplied params.

DeletionRequest.Builder setOriginUris(List<Uri> originUris)

Set the list of origin URI which will be used for matching.

DeletionRequest.Builder setStart(Instant start)

Set the start of the deletion range.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public DeletionRequest build ()

Builds a DeletionRequest instance.

Returns
DeletionRequest This value cannot be null.

setDeletionMode

public DeletionRequest.Builder setDeletionMode (int deletionMode)

Set the match behavior for the supplied params. DeletionRequest.DELETION_MODE_ALL: All data associated with the selected records will be deleted. DeletionRequest.DELETION_MODE_EXCLUDE_INTERNAL_DATA: All data except the internal system data (e.g. rate limits) associated with the selected records will be deleted.

Parameters
deletionMode int: Value is DeletionRequest.DELETION_MODE_ALL, or DeletionRequest.DELETION_MODE_EXCLUDE_INTERNAL_DATA

Returns
DeletionRequest.Builder This value cannot be null.

setDomainUris

public DeletionRequest.Builder setDomainUris (List<Uri> domainUris)

Set the list of domain URI which will be used for matching. These will be matched with records using the same domain or any subdomains. E.g. If domainUri is https://example.com, then https://a.example.com, https://example.com and https://b.example.com will match; https://abcexample.com will NOT match.

Parameters
domainUris List: This value may be null.

Returns
DeletionRequest.Builder This value cannot be null.

setEnd

public DeletionRequest.Builder setEnd (Instant end)

Set the end of the deletion range. Passing in Instant.MAX will cause everything from the specified start until the newest record to be deleted. No set end will default to Instant.MAX.

Parameters
end Instant: This value cannot be null.

Returns
DeletionRequest.Builder This value cannot be null.

setMatchBehavior

public DeletionRequest.Builder setMatchBehavior (int matchBehavior)

Set the match behavior for the supplied params. DeletionRequest.MATCH_BEHAVIOR_DELETE: This option will use the supplied params (Origin URIs & Domain URIs) for selecting records for deletion. DeletionRequest.MATCH_BEHAVIOR_PRESERVE: This option will preserve the data associated with the supplied params (Origin URIs & Domain URIs) and select remaining records for deletion.

Parameters
matchBehavior int: Value is DeletionRequest.MATCH_BEHAVIOR_DELETE, or DeletionRequest.MATCH_BEHAVIOR_PRESERVE

Returns
DeletionRequest.Builder This value cannot be null.

setOriginUris

public DeletionRequest.Builder setOriginUris (List<Uri> originUris)

Set the list of origin URI which will be used for matching. These will be matched with records using the same origin only, i.e. subdomains won't match. E.g. If originUri is https://a.example.com, then https://a.example.com will match; https://example.com, https://b.example.com and https://abcexample.com will NOT match.

Parameters
originUris List: This value may be null.

Returns
DeletionRequest.Builder This value cannot be null.

setStart

public DeletionRequest.Builder setStart (Instant start)

Set the start of the deletion range. Passing in Instant.MIN will cause everything from the oldest record to the specified end be deleted. No set start will default to Instant.MIN.

Parameters
start Instant: This value cannot be null.

Returns
DeletionRequest.Builder This value cannot be null.