io.camunda.zeebe.management.cluster.RoutingState Maven / Gradle / Ivy
package io.camunda.zeebe.management.cluster;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.camunda.zeebe.management.cluster.MessageCorrelation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
import jakarta.annotation.Generated;
/**
* The routing state, i.e. where requests are sent to and how messages are correlated
*/
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
@Schema(name = "RoutingState", description = "The routing state, i.e. where requests are sent to and how messages are correlated")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-09-24T12:12:47.003563022Z[GMT]", comments = "Generator version: 7.8.0")
public class RoutingState {
private Long version;
@Valid
private List activePartitions = new ArrayList<>();
private MessageCorrelation messageCorrelation;
public RoutingState() {
super();
}
/**
* Constructor with only required parameters
*/
public RoutingState(Long version, List activePartitions, MessageCorrelation messageCorrelation) {
this.version = version;
this.activePartitions = activePartitions;
this.messageCorrelation = messageCorrelation;
}
public RoutingState version(Long version) {
this.version = version;
return this;
}
/**
* The version of the routing state
* @return version
*/
@NotNull
@Schema(name = "version", example = "1", description = "The version of the routing state", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("version")
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
public RoutingState activePartitions(List activePartitions) {
this.activePartitions = activePartitions;
return this;
}
public RoutingState addActivePartitionsItem(Integer activePartitionsItem) {
if (this.activePartitions == null) {
this.activePartitions = new ArrayList<>();
}
this.activePartitions.add(activePartitionsItem);
return this;
}
/**
* The list of active partitions that accept round-robin requests
* @return activePartitions
*/
@NotNull
@Schema(name = "activePartitions", example = "[1,2,3]", description = "The list of active partitions that accept round-robin requests", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("activePartitions")
public List getActivePartitions() {
return activePartitions;
}
public void setActivePartitions(List activePartitions) {
this.activePartitions = activePartitions;
}
public RoutingState messageCorrelation(MessageCorrelation messageCorrelation) {
this.messageCorrelation = messageCorrelation;
return this;
}
/**
* Get messageCorrelation
* @return messageCorrelation
*/
@NotNull @Valid
@Schema(name = "messageCorrelation", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("messageCorrelation")
public MessageCorrelation getMessageCorrelation() {
return messageCorrelation;
}
public void setMessageCorrelation(MessageCorrelation messageCorrelation) {
this.messageCorrelation = messageCorrelation;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RoutingState routingState = (RoutingState) o;
return Objects.equals(this.version, routingState.version) &&
Objects.equals(this.activePartitions, routingState.activePartitions) &&
Objects.equals(this.messageCorrelation, routingState.messageCorrelation);
}
@Override
public int hashCode() {
return Objects.hash(version, activePartitions, messageCorrelation);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RoutingState {\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" activePartitions: ").append(toIndentedString(activePartitions)).append("\n");
sb.append(" messageCorrelation: ").append(toIndentedString(messageCorrelation)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}