/** * Create the partitioning. * * @throws java.lang.IllegalStateException if no fields have been added */ public Partitioning build() { if (fields.isEmpty()) { throw new IllegalStateException("Partitioning cannot be empty."); } return new Partitioning(fields); } }