Class ImmutableRangeMap.Builder<K extends java.lang.Comparable<?>,​V>

  • Enclosing class:
    ImmutableRangeMap<K extends java.lang.Comparable<?>,​V>

    public static final class ImmutableRangeMap.Builder<K extends java.lang.Comparable<?>,​V>
    extends java.lang.Object
    A builder for immutable range maps. Overlapping ranges are prohibited.
    Since:
    14.0
    • Constructor Detail

    • Method Detail

      • put

        public ImmutableRangeMap.Builder<K,​Vput​(Range<K> range,
                                                        V value)
        Associates the specified range with the specified value.
        Throws:
        java.lang.IllegalArgumentException - if range is empty
      • build

        public ImmutableRangeMap<K,​Vbuild()
        Returns an ImmutableRangeMap containing the associations previously added to this builder.
        Throws:
        java.lang.IllegalArgumentException - if any two ranges inserted into this builder overlap