@CanIgnoreReturnValue public static final class ImmutableLongArray.Builder extends Object
ImmutableLongArray
instances; obtained using ImmutableLongArray.builder(int)
.Modifier and Type | Method and Description |
---|---|
ImmutableLongArray.Builder |
add(long value)
Appends
value to the end of the values the built ImmutableLongArray will
contain. |
ImmutableLongArray.Builder |
addAll(Collection<Long> values)
Appends
values , in order, to the end of the values the built ImmutableLongArray will contain. |
ImmutableLongArray.Builder |
addAll(ImmutableLongArray values)
Appends
values , in order, to the end of the values the built ImmutableLongArray will contain. |
ImmutableLongArray.Builder |
addAll(Iterable<Long> values)
Appends
values , in order, to the end of the values the built ImmutableLongArray will contain. |
ImmutableLongArray.Builder |
addAll(long[] values)
Appends
values , in order, to the end of the values the built ImmutableLongArray will contain. |
ImmutableLongArray.Builder |
addAll(LongStream stream)
Appends all values from
stream , in order, to the end of the values the built ImmutableLongArray will contain. |
ImmutableLongArray |
build()
Returns a new immutable array.
|
public ImmutableLongArray.Builder add(long value)
value
to the end of the values the built ImmutableLongArray
will
contain.public ImmutableLongArray.Builder addAll(long[] values)
values
, in order, to the end of the values the built ImmutableLongArray
will contain.public ImmutableLongArray.Builder addAll(Iterable<Long> values)
values
, in order, to the end of the values the built ImmutableLongArray
will contain.public ImmutableLongArray.Builder addAll(Collection<Long> values)
values
, in order, to the end of the values the built ImmutableLongArray
will contain.public ImmutableLongArray.Builder addAll(LongStream stream)
stream
, in order, to the end of the values the built ImmutableLongArray
will contain.public ImmutableLongArray.Builder addAll(ImmutableLongArray values)
values
, in order, to the end of the values the built ImmutableLongArray
will contain.@CheckReturnValue public ImmutableLongArray 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–2019. All rights reserved.