public int numPartitions() {
        return numPartitions.orElse(CreateTopicsRequest.NO_NUM_PARTITIONS);
    }
The number of partitions for the new topic or -1 if a replica assignment has been specified.
clients/src/main/java/org/apache/kafka/clients/admin/NewTopic.java