content: /*
   * Management API
   *
   * The version of the OpenAPI document: 3
   *
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  package com.adyen.model.management;
  
  import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.util.*;
  import java.util.ArrayList;
  import java.util.List;
  
  /** SplitConfiguration */
  @JsonPropertyOrder({
    SplitConfiguration.JSON_PROPERTY_DESCRIPTION,
    SplitConfiguration.JSON_PROPERTY_RULES,
    SplitConfiguration.JSON_PROPERTY_SPLIT_CONFIGURATION_ID
  })
  public class SplitConfiguration {
    public static final String JSON_PROPERTY_DESCRIPTION = "description";
    private String description;
  
    public static final String JSON_PROPERTY_RULES = "rules";
    private List<SplitConfigurationRule> rules;
  
    public static final String JSON_PROPERTY_SPLIT_CONFIGURATION_ID = "splitConfigurationId";
    private String splitConfigurationId;
  
    public SplitConfiguration() {}
  
    @JsonCreator
    public SplitConfiguration(
        @JsonProperty(JSON_PROPERTY_SPLIT_CONFIGURATION_ID) String splitConfigurationId) {
      this();
      this.splitConfigurationId = splitConfigurationId;
    }
  
    /**
     * Your description for the split configuration.
     *
     * @param description Your description for the split configuration.
     * @return the current {@code SplitConfiguration} instance, allowing for method chaining
     */
    public SplitConfiguration description(String description) {
      this.description = description;
      return this;
    }
  
    /**
     * Your description for the split configuration.
     *
     * @return description Your description for the split configuration.
     */
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getDescription() {
      return description;
    }
  
    /**
     * Your description for the split configuration.
     *
     * @param description Your description for the split configuration.
     */
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDescription(String description) {
      this.description = description;
    }
  
    /**
     * Array of rules that define the split configuration behavior.
     *
     * @param rules Array of rules that define the split configuration behavior.
     * @return the current {@code SplitConfiguration} instance, allowing for method chaining
     */
    public SplitConfiguration rules(List<SplitConfigurationRule> rules) {
      this.rules = rules;
      return this;
    }
  
    public SplitConfiguration addRulesItem(SplitConfigurationRule rulesItem) {
      if (this.rules == null) {
        this.rules = new ArrayList<>();
      }
      this.rules.add(rulesItem);
      return this;
    }
  
    /**
     * Array of rules that define the split configuration behavior.
     *
     * @return rules Array of rules that define the split configuration behavior.
     */
    @JsonProperty(JSON_PROPERTY_RULES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<SplitConfigurationRule> getRules() {
      return rules;
    }
  
    /**
     * Array of rules that define the split configuration behavior.
     *
     * @param rules Array of rules that define the split configuration behavior.
     */
    @JsonProperty(JSON_PROPERTY_RULES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setRules(List<SplitConfigurationRule> rules) {
      this.rules = rules;
    }
  
    /**
     * Unique identifier of the split configuration.
     *
     * @return splitConfigurationId Unique identifier of the split configuration.
     */
    @JsonProperty(JSON_PROPERTY_SPLIT_CONFIGURATION_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getSplitConfigurationId() {
      return splitConfigurationId;
    }
  
    /** Return true if this SplitConfiguration object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      SplitConfiguration splitConfiguration = (SplitConfiguration) o;
      return Objects.equals(this.description, splitConfiguration.description)
          && Objects.equals(this.rules, splitConfiguration.rules)
          && Objects.equals(this.splitConfigurationId, splitConfiguration.splitConfigurationId);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(description, rules, splitConfigurationId);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class SplitConfiguration {\n");
      sb.append("    description: ").append(toIndentedString(description)).append("\n");
      sb.append("    rules: ").append(toIndentedString(rules)).append("\n");
      sb.append("    splitConfigurationId: ")
          .append(toIndentedString(splitConfigurationId))
          .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    ");
    }
  
    /**
     * Create an instance of SplitConfiguration given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of SplitConfiguration
     * @throws JsonProcessingException if the JSON string is invalid with respect to
     *     SplitConfiguration
     */
    public static SplitConfiguration fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, SplitConfiguration.class);
    }
  
    /**
     * Convert an instance of SplitConfiguration to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  