All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.camunda.zeebe.management.cluster.Operation Maven / Gradle / Ivy

There is a newer version: 8.7.0-alpha1
Show newest version
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 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;

/**
 * Operation
 */
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-08-06T14:30:47.410826531Z[GMT]", comments = "Generator version: 7.4.0")
public class Operation {

  /**
   * Gets or Sets operation
   */
  public enum OperationEnum {
    BROKER_ADD("BROKER_ADD"),
    
    BROKER_REMOVE("BROKER_REMOVE"),
    
    PARTITION_JOIN("PARTITION_JOIN"),
    
    PARTITION_LEAVE("PARTITION_LEAVE"),
    
    PARTITION_RECONFIGURE_PRIORITY("PARTITION_RECONFIGURE_PRIORITY"),
    
    PARTITION_FORCE_RECONFIGURE("PARTITION_FORCE_RECONFIGURE"),
    
    BROKER_FORCE_REMOVE("BROKER_FORCE_REMOVE");

    private String value;

    OperationEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static OperationEnum fromValue(String value) {
      for (OperationEnum b : OperationEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  private OperationEnum operation;

  private Integer brokerId;

  private Integer partitionId;

  private Integer priority;

  @Valid
  private List brokers;

  public Operation operation(OperationEnum operation) {
    this.operation = operation;
    return this;
  }

  /**
   * Get operation
   * @return operation
  */
  
  @Schema(name = "operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("operation")
  public OperationEnum getOperation() {
    return operation;
  }

  public void setOperation(OperationEnum operation) {
    this.operation = operation;
  }

  public Operation brokerId(Integer brokerId) {
    this.brokerId = brokerId;
    return this;
  }

  /**
   * The ID of a broker, starting from 0
   * @return brokerId
  */
  
  @Schema(name = "brokerId", example = "0", description = "The ID of a broker, starting from 0", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("brokerId")
  public Integer getBrokerId() {
    return brokerId;
  }

  public void setBrokerId(Integer brokerId) {
    this.brokerId = brokerId;
  }

  public Operation partitionId(Integer partitionId) {
    this.partitionId = partitionId;
    return this;
  }

  /**
   * The ID of a partition, starting from 1
   * @return partitionId
  */
  
  @Schema(name = "partitionId", example = "1", description = "The ID of a partition, starting from 1", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("partitionId")
  public Integer getPartitionId() {
    return partitionId;
  }

  public void setPartitionId(Integer partitionId) {
    this.partitionId = partitionId;
  }

  public Operation priority(Integer priority) {
    this.priority = priority;
    return this;
  }

  /**
   * The priority of the partition
   * @return priority
  */
  
  @Schema(name = "priority", example = "3", 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 Operation brokers(List brokers) {
    this.brokers = brokers;
    return this;
  }

  public Operation addBrokersItem(Integer brokersItem) {
    if (this.brokers == null) {
      this.brokers = new ArrayList<>();
    }
    this.brokers.add(brokersItem);
    return this;
  }

  /**
   * Get brokers
   * @return brokers
  */
  
  @Schema(name = "brokers", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("brokers")
  public List getBrokers() {
    return brokers;
  }

  public void setBrokers(List brokers) {
    this.brokers = brokers;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Operation operation = (Operation) o;
    return Objects.equals(this.operation, operation.operation) &&
        Objects.equals(this.brokerId, operation.brokerId) &&
        Objects.equals(this.partitionId, operation.partitionId) &&
        Objects.equals(this.priority, operation.priority) &&
        Objects.equals(this.brokers, operation.brokers);
  }

  @Override
  public int hashCode() {
    return Objects.hash(operation, brokerId, partitionId, priority, brokers);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Operation {\n");
    sb.append("    operation: ").append(toIndentedString(operation)).append("\n");
    sb.append("    brokerId: ").append(toIndentedString(brokerId)).append("\n");
    sb.append("    partitionId: ").append(toIndentedString(partitionId)).append("\n");
    sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
    sb.append("    brokers: ").append(toIndentedString(brokers)).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    ");
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy