Package io.vertx.kafka.admin

## Class NewPartitions

- java.lang.Object
- - io.vertx.kafka.admin.NewPartitions

-     public class NewPartitions
      extends Object

  An update to the number of partitions including assignment. Partitions can be increased only. If decrease, an exception from Kafka broker is received. If no assignment is specifies brokers will randomly assign the partitions.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NewPartitions()` | Constructor
    `NewPartitions​(int totalCount, List<List<Integer>> newAssignments)` | Constructor
    `NewPartitions​(JsonObject json)` | Constructor (from JSON representation)

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<List<Integer>>` | `getNewAssignments()` |
    `int` | `getTotalCount()` |
    `void` | `NewPartitions​(int totalCount)` | Constructor
    `NewPartitions` | `setNewAssignments​(List<List<Integer>> assignments)` | Set the assignment for the new partitions
    `NewPartitions` | `setTotalCount​(int totalCount)` | Set the number of partitions for the topic
    `JsonObject` | `toJson()` | Convert object to JSON representation
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NewPartitions

          public NewPartitions()

      Constructor

    - #### NewPartitions

          public NewPartitions​(int totalCount,
                               List<List<Integer>> newAssignments)

      Constructor
      Parameters:
        `totalCount` - total count of partitions
        `newAssignments` - assignment to the brokers

    - #### NewPartitions

          public NewPartitions​(JsonObject json)

      Constructor (from JSON representation)
      Parameters:
        `json` - JSON representation

  - ### Method Detail

    - #### NewPartitions

          public void NewPartitions​(int totalCount)

      Constructor
      Parameters:
        `totalCount` - total count of partitions

    - #### setTotalCount

          public NewPartitions setTotalCount​(int totalCount)

      Set the number of partitions for the topic
      Parameters:
        `totalCount` - the number of partitions for the topic
      Returns:
        current instance of the class to be fluent

    - #### setNewAssignments

          public NewPartitions setNewAssignments​(List<List<Integer>> assignments)

      Set the assignment for the new partitions
      Parameters:
        `assignments` - assignments of the partitions to the brokers
      Returns:
        current instance of the class to be fluent

    - #### getTotalCount

          public int getTotalCount()

      Returns:
        number of total partitions

    - #### getNewAssignments

          public List<List<Integer>> getNewAssignments()

      Returns:
        assignment of partitions to the brokers

    - #### toJson

          public JsonObject toJson()

      Convert object to JSON representation
      Returns:
        JSON representation

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`