Class ImmutableRangeMap.Builder<K extends Comparable<?>, V>
java.lang.Object
com.google.common.collect.ImmutableRangeMap.Builder<K,V>
- Enclosing class:
ImmutableRangeMap<K extends Comparable<?>, V>
@DoNotMock
public static final class ImmutableRangeMap.Builder<K extends Comparable<?>, V>
extends Object
A builder for immutable range maps. Overlapping ranges are prohibited.
- Since:
- 14.0
- Author:
- Louis Wasserman
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns anImmutableRangeMapcontaining the associations previously added to this builder.Associates the specified range with the specified value.Copies all associations from the specified range map into this builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
put
Associates the specified range with the specified value.- Throws:
IllegalArgumentException- ifrangeis empty
-
putAll
@CanIgnoreReturnValue public ImmutableRangeMap.Builder<K,V> putAll(RangeMap<K, ? extends V> rangeMap) Copies all associations from the specified range map into this builder. -
build
Returns anImmutableRangeMapcontaining the associations previously added to this builder.- Throws:
IllegalArgumentException- if any two ranges inserted into this builder overlap
-