@CanIgnoreReturnValue public static final class ImmutableIntArray.Builder extends Object
ImmutableIntArray
instances; obtained using ImmutableIntArray.builder(int)
.Modifier and Type | Method and Description |
---|---|
ImmutableIntArray.Builder |
add(int value)
Appends
value to the end of the values the built ImmutableIntArray will
contain. |
ImmutableIntArray.Builder |
addAll(Collection<Integer> values)
Appends
values , in order, to the end of the values the built ImmutableIntArray will contain. |
ImmutableIntArray.Builder |
addAll(ImmutableIntArray values)
Appends
values , in order, to the end of the values the built ImmutableIntArray will contain. |
ImmutableIntArray.Builder |
addAll(int[] values)
Appends
values , in order, to the end of the values the built ImmutableIntArray will contain. |
ImmutableIntArray.Builder |
addAll(IntStream stream)
Appends all values from
stream , in order, to the end of the values the built ImmutableIntArray will contain. |
ImmutableIntArray.Builder |
addAll(Iterable<Integer> values)
Appends
values , in order, to the end of the values the built ImmutableIntArray will contain. |
ImmutableIntArray |
build()
Returns a new immutable array.
|
public ImmutableIntArray.Builder add(int value)
value
to the end of the values the built ImmutableIntArray
will
contain.public ImmutableIntArray.Builder addAll(int[] values)
values
, in order, to the end of the values the built ImmutableIntArray
will contain.public ImmutableIntArray.Builder addAll(Iterable<Integer> values)
values
, in order, to the end of the values the built ImmutableIntArray
will contain.public ImmutableIntArray.Builder addAll(Collection<Integer> values)
values
, in order, to the end of the values the built ImmutableIntArray
will contain.public ImmutableIntArray.Builder addAll(IntStream stream)
stream
, in order, to the end of the values the built ImmutableIntArray
will contain.public ImmutableIntArray.Builder addAll(ImmutableIntArray values)
values
, in order, to the end of the values the built ImmutableIntArray
will contain.@CheckReturnValue public ImmutableIntArray build()
Performance note: the returned array is backed by the same array as the builder, so
no data is copied as part of this step, but this may occupy more memory than strictly
necessary. To copy the data to a right-sized backing array, use .build().trimmed()
.
Copyright © 2010–2017. All rights reserved.