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

    • Constructor Detail

      • Builder

        public Builder()
        Creates a new builder. The returned builder is equivalent to the builder generated by ImmutableTable.builder().
    • Method Detail

      • orderRowsBy

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

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

        public ImmutableTable.Builder<R,​C,​V> put​(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

        public ImmutableTable.Builder<R,​C,​V> put​(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

        public ImmutableTable.Builder<R,​C,​V> putAll​(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,​V> build()
        Returns a newly-created immutable table.
        Throws:
        java.lang.IllegalArgumentException - if duplicate key pairs were added