public final class

Data.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.work.Data.Builder

Overview

A builder for Data objects.

Summary

Constructors
publicBuilder()

Methods
public Databuild()

Builds a Data object.

public Data.Builderput(java.lang.String key, java.lang.Object value)

Puts an input key-value pair into the Builder.

public Data.BuilderputAll(Data data)

Puts all input key-value pairs from a Data into the Builder.

public Data.BuilderputAll(java.util.Map<java.lang.String, java.lang.Object> values)

Puts all input key-value pairs from a java.util.Map into the Builder.

public Data.BuilderputBoolean(java.lang.String key, boolean value)

Puts a boolean into the arguments.

public Data.BuilderputBooleanArray(java.lang.String key, boolean[] value[])

Puts a boolean array into the arguments.

public Data.BuilderputByte(java.lang.String key, byte value)

Puts an byte into the arguments.

public Data.BuilderputByteArray(java.lang.String key, byte[] value[])

Puts an integer array into the arguments.

public Data.BuilderputDouble(java.lang.String key, double value)

Puts a double into the arguments.

public Data.BuilderputDoubleArray(java.lang.String key, double[] value[])

Puts a double array into the arguments.

public Data.BuilderputFloat(java.lang.String key, float value)

Puts a float into the arguments.

public Data.BuilderputFloatArray(java.lang.String key, float[] value[])

Puts a float array into the arguments.

public Data.BuilderputInt(java.lang.String key, int value)

Puts an integer into the arguments.

public Data.BuilderputIntArray(java.lang.String key, int[] value[])

Puts an integer array into the arguments.

public Data.BuilderputLong(java.lang.String key, long value)

Puts a long into the arguments.

public Data.BuilderputLongArray(java.lang.String key, long[] value[])

Puts a long array into the arguments.

public Data.BuilderputString(java.lang.String key, java.lang.String value)

Puts a String into the arguments.

public Data.BuilderputStringArray(java.lang.String key, java.lang.String value[])

Puts a String array into the arguments.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public Data.Builder putBoolean(java.lang.String key, boolean value)

Puts a boolean into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putBooleanArray(java.lang.String key, boolean[] value[])

Puts a boolean array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putByte(java.lang.String key, byte value)

Puts an byte into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putByteArray(java.lang.String key, byte[] value[])

Puts an integer array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putInt(java.lang.String key, int value)

Puts an integer into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putIntArray(java.lang.String key, int[] value[])

Puts an integer array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putLong(java.lang.String key, long value)

Puts a long into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putLongArray(java.lang.String key, long[] value[])

Puts a long array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putFloat(java.lang.String key, float value)

Puts a float into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putFloatArray(java.lang.String key, float[] value[])

Puts a float array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putDouble(java.lang.String key, double value)

Puts a double into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putDoubleArray(java.lang.String key, double[] value[])

Puts a double array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putString(java.lang.String key, java.lang.String value)

Puts a String into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putStringArray(java.lang.String key, java.lang.String value[])

Puts a String array into the arguments.

Parameters:

key: The key for this argument
value: The value for this argument

Returns:

The Data.Builder

public Data.Builder putAll(Data data)

Puts all input key-value pairs from a Data into the Builder.

Valid value types are: Boolean, Integer, Long, Float, Double, String, and their array versions. Invalid types will throw an java.lang.IllegalArgumentException.

Parameters:

data: Data containing key-value pairs to add

Returns:

The Data.Builder

public Data.Builder putAll(java.util.Map<java.lang.String, java.lang.Object> values)

Puts all input key-value pairs from a java.util.Map into the Builder.

Valid value types are: Boolean, Integer, Long, Float, Double, String, and their array versions. Invalid types will throw an java.lang.IllegalArgumentException.

Parameters:

values: A java.util.Map of key-value pairs to add

Returns:

The Data.Builder

public Data.Builder put(java.lang.String key, java.lang.Object value)

Puts an input key-value pair into the Builder. Valid types are: Boolean, Integer, Long, Float, Double, String, and array versions of each of those types. Invalid types throw an java.lang.IllegalArgumentException.

Parameters:

key: A java.lang.String key to add
value: A nullable java.lang.Object value to add of the valid types

Returns:

The Data.Builder

public Data build()

Builds a Data object.

Returns:

The Data object containing all key-value pairs specified by this Data.Builder.