DeletionRequest.Builder


@RequiresApi(value = 26)
public final class DeletionRequest.Builder


Builder for {@link DeletionRequest} objects.

Summary

Public constructors

Builder(int deletionMode, int matchBehavior)

Public methods

final @NonNull DeletionRequest

Builds a {@link DeletionRequest} instance.

final @NonNull DeletionRequest.Builder

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

final @NonNull DeletionRequest.Builder

Sets the end of the deletion range.

final @NonNull DeletionRequest.Builder

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

final @NonNull DeletionRequest.Builder

Sets the start of the deletion range.

Public constructors

Builder

Added in 1.0.0
public Builder(int deletionMode, int matchBehavior)
Parameters
int deletionMode

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

int matchBehavior

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

Public methods

build

Added in 1.0.0
public final @NonNull DeletionRequest build()

Builds a {@link DeletionRequest} instance.

setDomainUris

public final @NonNull DeletionRequest.Builder setDomainUris(@NonNull List<@NonNull 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 {@code https://example.com}, then {@code https://a.example.com}, {@code https://example.com} and {@code https://b.example.com} will match; {@code https://abcexample.com} will NOT match. A null or empty list will match everything.

setEnd

Added in 1.0.0
public final @NonNull DeletionRequest.Builder setEnd(@NonNull Instant end)

Sets the end of the deletion range. Not setting this or passing in {@link java.time.Instant#MAX} will cause everything from the specified start until the newest record to be deleted.

setOriginUris

public final @NonNull DeletionRequest.Builder setOriginUris(@NonNull List<@NonNull 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 {@code https://a.example.com}, then {@code https://a.example.com} will match; {@code https://example.com}, {@code https://b.example.com} and {@code https://abcexample.com} will NOT match. A null or empty list will match everything.

setStart

Added in 1.0.0
public final @NonNull DeletionRequest.Builder setStart(@NonNull Instant start)

Sets the start of the deletion range. Not setting this or passing in {@link java.time.Instant#MIN} will cause everything from the oldest record to the specified end be deleted.