Class ImmutableIntArray.Builder

    • Method Detail

      • addAll

        @CanIgnoreReturnValue
        public ImmutableIntArray.Builder addAll​(java.util.stream.IntStream stream)
        Appends all values from stream, in order, to the end of the values the built ImmutableIntArray will contain.
        Since:
        22.0 (but only since 33.4.0 in the Android flavor)
      • build

        public ImmutableIntArray build()
        Returns a new immutable array. The builder can continue to be used after this call, to append more values and build again.

        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().