public static class ImmutableTable.Builder extends Object
ImmutableTable
.Constructor and Description |
---|
Builder()
Constructs a new empty builder.
|
Builder(ImmutableTable.Builder builder)
Constructs a copy of the given builder (a copy constructor).
|
Modifier and Type | Method and Description |
---|---|
ImmutableTable.Builder |
add(Object key,
Object value)
Sets the value associated with the key
key to value . |
ImmutableTable |
build()
Constructs and returns a new immutable table based on the contents of this
builder.
|
void |
clear()
Clears the builder.
|
public Builder()
public Builder(ImmutableTable.Builder builder)
builder
- the original builder, must not be null
NullPointerException
- if builder
is null
public ImmutableTable.Builder add(Object key, Object value)
key
to value
.
The behaviour of this method is similar to that of
Table.rawset(Object, Object)
:
value
is nil (i.e., null
), the key key
will not have any value associated with it after this method returns;IllegalArgumentException
;The method returns this
, allowing calls to this method to be chained.
key
- the key, must not be null
or NaNvalue
- the value, may be null
IllegalArgumentException
- when key
is null
or a NaNpublic void clear()
public ImmutableTable build()
Copyright © 2016. All rights reserved.