Class ImmutableTable.Builder<R,​C,​V>

    • Method Detail

      • orderRowsBy

        @CanIgnoreReturnValue
        public ImmutableTable.Builder<R,​C,​VorderRowsBy​(java.util.Comparator<? super R> rowComparator)
        Specifies the ordering of the generated table's rows.
      • orderColumnsBy

        @CanIgnoreReturnValue
        public ImmutableTable.Builder<R,​C,​VorderColumnsBy​(java.util.Comparator<? super C> columnComparator)
        Specifies the ordering of the generated table's columns.
      • put

        @CanIgnoreReturnValue
        public ImmutableTable.Builder<R,​C,​Vput​(R rowKey,
                                                             C columnKey,
                                                             V value)
        Associates the (rowKey, columnKey) pair with value in the built table. Duplicate key pairs are not allowed and will cause build() to fail.
      • put

        @CanIgnoreReturnValue
        public ImmutableTable.Builder<R,​C,​Vput​(Table.Cell<? extends R,​? extends C,​? extends V> cell)
        Adds the given cell to the table, making it immutable if necessary. Duplicate key pairs are not allowed and will cause build() to fail.
      • putAll

        @CanIgnoreReturnValue
        public ImmutableTable.Builder<R,​C,​VputAll​(Table<? extends R,​? extends C,​? extends V> table)
        Associates all of the given table's keys and values in the built table. Duplicate row key column key pairs are not allowed, and will cause build() to fail.
        Throws:
        java.lang.NullPointerException - if any key or value in table is null
      • build

        public ImmutableTable<R,​C,​Vbuild()
        Returns a newly-created immutable table.

        Prefer the equivalent method buildOrThrow() to make it explicit that the method will throw an exception if there are duplicate key pairs. The build() method will soon be deprecated.

        Throws:
        java.lang.IllegalArgumentException - if duplicate key pairs were added
      • buildOrThrow

        public ImmutableTable<R,​C,​VbuildOrThrow()
        Returns a newly-created immutable table, or throws an exception if duplicate key pairs were added.
        Throws:
        java.lang.IllegalArgumentException - if duplicate key pairs were added
        Since:
        31.0