io.camunda.zeebe.management.cluster.PartitionState 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 com.fasterxml.jackson.annotation.JsonValue;
import io.camunda.zeebe.management.cluster.PartitionConfig;
import io.camunda.zeebe.management.cluster.PartitionStateCode;
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;
/**
* PartitionState
*/
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-10-02T11:21:27.419777225Z[GMT]", comments = "Generator version: 7.8.0")
public class PartitionState {
private Integer id;
private PartitionStateCode state;
private Integer priority;
private PartitionConfig config;
public PartitionState id(Integer id) {
this.id = id;
return this;
}
/**
* The ID of a partition, starting from 1
* @return id
*/
@Schema(name = "id", example = "1", description = "The ID of a partition, starting from 1", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public PartitionState state(PartitionStateCode state) {
this.state = state;
return this;
}
/**
* Get state
* @return state
*/
@Valid
@Schema(name = "state", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("state")
public PartitionStateCode getState() {
return state;
}
public void setState(PartitionStateCode state) {
this.state = state;
}
public PartitionState priority(Integer priority) {
this.priority = priority;
return this;
}
/**
* The priority of the partition
* @return priority
*/
@Schema(name = "priority", example = "1", description = "The priority of the partition", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("priority")
public Integer getPriority() {
return priority;
}
public void setPriority(Integer priority) {
this.priority = priority;
}
public PartitionState config(PartitionConfig config) {
this.config = config;
return this;
}
/**
* Get config
* @return config
*/
@Valid
@Schema(name = "config", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("config")
public PartitionConfig getConfig() {
return config;
}
public void setConfig(PartitionConfig config) {
this.config = config;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PartitionState partitionState = (PartitionState) o;
return Objects.equals(this.id, partitionState.id) &&
Objects.equals(this.state, partitionState.state) &&
Objects.equals(this.priority, partitionState.priority) &&
Objects.equals(this.config, partitionState.config);
}
@Override
public int hashCode() {
return Objects.hash(id, state, priority, config);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PartitionState {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
sb.append(" config: ").append(toIndentedString(config)).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 ");
}
}