Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
public class RepartitionHint {

    public final String topicName;
    public final Integer topicPartitions;
    public final Boolean repartitionRequired;

    publicprivate RepartitionHint (String topicName) {
        this.topicName = topicName;
        this.topicPartitions = null;
        this.repartitionRequired = true;
    }

    publicprivate RepartitionHint (String topicName, Integer topicPartitions) {
        this.topicName = topicName;
        this.topicPartitions = topicPartitions;
        this.repartitionRequired = true;
    }

    publicprivate RepartitionHint (Boolean repartitionRequired) {
        this.topicName = null;
        this.topicPartitions = null;
        this.repartitionRequired = repartitionRequired;
    }
    
    publicprivate RepartitionHint (String topicName, Integer topicPartitions, Boolean repartitionRequired) {
        this.topicName = topicName;
        this.topicPartitions = topicPartitions;
        this.repartitionRequired = repartitionRequired;
    }

    public String getTopicName() {
        return topicName;
    }

    public Integer getTopicPartitions() {
        return topicPartitions;
    }
 
	public RepartitionHint withTopicName(String topicName) {
       this.topicName = topicName;
    }
 
	public RepartitionHint withTopicPartitions(String topicPartitions) {
       this.topicPartitions = topicPartitions;
    }
 
	public RepartitionHint requiredRepartition(Boolean repartitionRequired) {
       this.repartitionRequired = repartitionRequired;
    }
}

 

Proposed Changes

 

We try to avoid many overloads by not implementing all the overloaded combinations of related methods.

...