Data.Builder


public final class Data.Builder


A builder for Data objects.

Summary

Public constructors

Public methods

final @NonNull Data

Builds a Data object.

final @NonNull Data.Builder

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

final @NonNull Data.Builder

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

final @NonNull Data.Builder
putBoolean(@NonNull String key, boolean value)

Puts a boolean into the arguments.

final @NonNull Data.Builder
putBooleanArray(@NonNull String key, @NonNull boolean[] value)

Puts a boolean array into the arguments.

final @NonNull Data.Builder
putByte(@NonNull String key, byte value)

Puts an byte into the arguments.

final @NonNull Data.Builder
putByteArray(@NonNull String key, @NonNull byte[] value)

Puts an integer array into the arguments.

final @NonNull Data.Builder
putDouble(@NonNull String key, double value)

Puts a double into the arguments.

final @NonNull Data.Builder
putDoubleArray(@NonNull String key, @NonNull double[] value)

Puts a double array into the arguments.

final @NonNull Data.Builder
putFloat(@NonNull String key, float value)

Puts a float into the arguments.

final @NonNull Data.Builder
putFloatArray(@NonNull String key, @NonNull float[] value)

Puts a float array into the arguments.

final @NonNull Data.Builder
putInt(@NonNull String key, int value)

Puts an integer into the arguments.

final @NonNull Data.Builder
putIntArray(@NonNull String key, @NonNull int[] value)

Puts an integer array into the arguments.

final @NonNull Data.Builder
putLong(@NonNull String key, long value)

Puts a long into the arguments.

final @NonNull Data.Builder
putLongArray(@NonNull String key, @NonNull long[] value)

Puts a long array into the arguments.

final @NonNull Data.Builder
putString(@NonNull String key, String value)

Puts a String into the arguments.

final @NonNull Data.Builder
putStringArray(@NonNull String key, @NonNull String[] value)

Puts a String array into the arguments.

Public constructors

Builder

Added in 1.0.0
public Builder()

Public methods

build

Added in 1.0.0
public final @NonNull Data build()

Builds a Data object.

Returns
@NonNull Data

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

putAll

Added in 1.0.0
public final @NonNull Data.Builder putAll(@NonNull 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 IllegalArgumentException.

Parameters
@NonNull Data data

Data containing key-value pairs to add

putAll

Added in 1.0.0
public final @NonNull Data.Builder putAll(@NonNull Map<@NonNull StringObject> values)

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

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

Parameters
@NonNull Map<@NonNull StringObject> values

A Map of key-value pairs to add

putBoolean

Added in 1.0.0
public final @NonNull Data.Builder putBoolean(@NonNull String key, boolean value)

Puts a boolean into the arguments.

Parameters
@NonNull String key

The key for this argument

boolean value

The value for this argument

putBooleanArray

Added in 1.0.0
public final @NonNull Data.Builder putBooleanArray(@NonNull String key, @NonNull boolean[] value)

Puts a boolean array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull boolean[] value

The value for this argument

putByte

Added in 2.1.0
public final @NonNull Data.Builder putByte(@NonNull String key, byte value)

Puts an byte into the arguments.

Parameters
@NonNull String key

The key for this argument

byte value

The value for this argument

putByteArray

Added in 2.1.0
public final @NonNull Data.Builder putByteArray(@NonNull String key, @NonNull byte[] value)

Puts an integer array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull byte[] value

The value for this argument

putDouble

Added in 1.0.0
public final @NonNull Data.Builder putDouble(@NonNull String key, double value)

Puts a double into the arguments.

Parameters
@NonNull String key

The key for this argument

double value

The value for this argument

putDoubleArray

Added in 1.0.0
public final @NonNull Data.Builder putDoubleArray(@NonNull String key, @NonNull double[] value)

Puts a double array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull double[] value

The value for this argument

putFloat

Added in 1.0.0
public final @NonNull Data.Builder putFloat(@NonNull String key, float value)

Puts a float into the arguments.

Parameters
@NonNull String key

The key for this argument

float value

The value for this argument

putFloatArray

Added in 1.0.0
public final @NonNull Data.Builder putFloatArray(@NonNull String key, @NonNull float[] value)

Puts a float array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull float[] value

The value for this argument

putInt

Added in 1.0.0
public final @NonNull Data.Builder putInt(@NonNull String key, int value)

Puts an integer into the arguments.

Parameters
@NonNull String key

The key for this argument

int value

The value for this argument

putIntArray

Added in 1.0.0
public final @NonNull Data.Builder putIntArray(@NonNull String key, @NonNull int[] value)

Puts an integer array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull int[] value

The value for this argument

putLong

Added in 1.0.0
public final @NonNull Data.Builder putLong(@NonNull String key, long value)

Puts a long into the arguments.

Parameters
@NonNull String key

The key for this argument

long value

The value for this argument

putLongArray

Added in 1.0.0
public final @NonNull Data.Builder putLongArray(@NonNull String key, @NonNull long[] value)

Puts a long array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull long[] value

The value for this argument

putString

Added in 1.0.0
public final @NonNull Data.Builder putString(@NonNull String key, String value)

Puts a String into the arguments.

Parameters
@NonNull String key

The key for this argument

String value

The value for this argument

putStringArray

Added in 1.0.0
public final @NonNull Data.Builder putStringArray(@NonNull String key, @NonNull String[] value)

Puts a String array into the arguments.

Parameters
@NonNull String key

The key for this argument

@NonNull String[] value

The value for this argument