Returns a newly-created immutable table. @throws IllegalArgumentException if duplicate key pairs were added
()
| 237 | |
| 238 | |
| 239 | public ImmutableTable<R, C, V> build() { |
| 240 | int size = cells.size(); |
| 241 | switch (size) { |
| 242 | case 0: |
| 243 | return of(); |
| 244 | case 1: |
| 245 | return new SingletonImmutableTable<R, C, V>(Iterables.getOnlyElement(cells)); |
| 246 | default: |
| 247 | return RegularImmutableTable.forCells(cells, rowComparator, columnComparator); |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | ImmutableTable() {} |
no test coverage detected