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

openapitools.model.ChildAA Maven / Gradle / Ivy

There is a newer version: 1.23.1
Show newest version
/*
 * Product Base Definitions
 * This component represents the Open API interface of the accounting service. 
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package openapitools.model;

import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import openapitools.model.BankAccount;
import openapitools.model.ChildA;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import openapitools.JSON;


/**
 *  <br><br> Deprecated: Please do not use this class any longer. There are better alternatives but I do not tell you which ones. May be `java.lang.Nothing` (since: 0.5, removed with: 2.0) 
 * @deprecated
 */
@Deprecated
@JsonPropertyOrder({
  ChildAA.JSON_PROPERTY_CHILD_A_A_ATTRIBUTE,
  ChildAA.JSON_PROPERTY_SIZED_ARRAY,
  ChildAA.JSON_PROPERTY_REQUIRED_ARRAY,
  ChildAA.JSON_PROPERTY_BIG_INTEGER_CODE,
  ChildAA.JSON_PROPERTY_INTEGER_CODE,
  ChildAA.JSON_PROPERTY_CODES
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
@JsonIgnoreProperties(
  value = "objectType", // ignore manually set objectType, it will be automatically generated by Jackson during serialization
  allowSetters = true // allows the objectType to be set during deserialization
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", visible = true)

public class ChildAA extends ChildA {
  public static final String JSON_PROPERTY_CHILD_A_A_ATTRIBUTE = "childAAAttribute";
  private Integer childAAAttribute;

  public static final String JSON_PROPERTY_SIZED_ARRAY = "sizedArray";
  private JsonNullable> sizedArray = JsonNullable.>undefined();

  public static final String JSON_PROPERTY_REQUIRED_ARRAY = "requiredArray";
  private List requiredArray = new ArrayList<>();

  public static final String JSON_PROPERTY_BIG_INTEGER_CODE = "bigIntegerCode";
  private Long bigIntegerCode;

  public static final String JSON_PROPERTY_INTEGER_CODE = "integerCode";
  private Integer integerCode;

  public static final String JSON_PROPERTY_CODES = "codes";
  private JsonNullable> codes = JsonNullable.>undefined();

  public ChildAA() { 
  }

  public ChildAA childAAAttribute(Integer childAAAttribute) {
    this.childAAAttribute = childAAAttribute;
    return this;
  }

  /**
   * Multi line docs 
   * @return childAAAttribute
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CHILD_A_A_ATTRIBUTE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getChildAAAttribute() {
    return childAAAttribute;
  }


  @JsonProperty(JSON_PROPERTY_CHILD_A_A_ATTRIBUTE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setChildAAAttribute(Integer childAAAttribute) {
    this.childAAAttribute = childAAAttribute;
  }


  public ChildAA sizedArray(List sizedArray) {
    this.sizedArray = JsonNullable.>of(sizedArray);
    return this;
  }

  public ChildAA addSizedArrayItem(Integer sizedArrayItem) {
    if (this.sizedArray == null || !this.sizedArray.isPresent()) {
      this.sizedArray = JsonNullable.>of(new ArrayList<>());
    }
    try {
      this.sizedArray.get().add(sizedArrayItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

  /**
   * Get sizedArray
   * @return sizedArray
   */
  @javax.annotation.Nullable
  @JsonIgnore

  public List getSizedArray() {
        return sizedArray.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_SIZED_ARRAY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getSizedArray_JsonNullable() {
    return sizedArray;
  }
  
  @JsonProperty(JSON_PROPERTY_SIZED_ARRAY)
  public void setSizedArray_JsonNullable(JsonNullable> sizedArray) {
    this.sizedArray = sizedArray;
  }

  public void setSizedArray(List sizedArray) {
    this.sizedArray = JsonNullable.>of(sizedArray);
  }


  public ChildAA requiredArray(List requiredArray) {
    this.requiredArray = requiredArray;
    return this;
  }

  public ChildAA addRequiredArrayItem(String requiredArrayItem) {
    if (this.requiredArray == null) {
      this.requiredArray = new ArrayList<>();
    }
    this.requiredArray.add(requiredArrayItem);
    return this;
  }

  /**
   * Get requiredArray
   * @return requiredArray
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_REQUIRED_ARRAY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getRequiredArray() {
    return requiredArray;
  }


  @JsonProperty(JSON_PROPERTY_REQUIRED_ARRAY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setRequiredArray(List requiredArray) {
    this.requiredArray = requiredArray;
  }


  public ChildAA bigIntegerCode(Long bigIntegerCode) {
    this.bigIntegerCode = bigIntegerCode;
    return this;
  }

  /**
   * Get bigIntegerCode
   * maximum: 4711
   * @return bigIntegerCode
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_BIG_INTEGER_CODE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Long getBigIntegerCode() {
    return bigIntegerCode;
  }


  @JsonProperty(JSON_PROPERTY_BIG_INTEGER_CODE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setBigIntegerCode(Long bigIntegerCode) {
    this.bigIntegerCode = bigIntegerCode;
  }


  public ChildAA integerCode(Integer integerCode) {
    this.integerCode = integerCode;
    return this;
  }

  /**
   * Get integerCode
   * @return integerCode
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_INTEGER_CODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getIntegerCode() {
    return integerCode;
  }


  @JsonProperty(JSON_PROPERTY_INTEGER_CODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setIntegerCode(Integer integerCode) {
    this.integerCode = integerCode;
  }


  public ChildAA codes(List codes) {
    this.codes = JsonNullable.>of(codes);
    return this;
  }

  public ChildAA addCodesItem(Integer codesItem) {
    if (this.codes == null || !this.codes.isPresent()) {
      this.codes = JsonNullable.>of(new ArrayList<>());
    }
    try {
      this.codes.get().add(codesItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

  /**
   * Get codes
   * @return codes
   */
  @javax.annotation.Nullable
  @JsonIgnore

  public List getCodes() {
        return codes.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_CODES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getCodes_JsonNullable() {
    return codes;
  }
  
  @JsonProperty(JSON_PROPERTY_CODES)
  public void setCodes_JsonNullable(JsonNullable> codes) {
    this.codes = codes;
  }

  public void setCodes(List codes) {
    this.codes = JsonNullable.>of(codes);
  }


  /**
   * Return true if this ChildAA object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ChildAA childAA = (ChildAA) o;
    return Objects.equals(this.childAAAttribute, childAA.childAAAttribute) &&
        equalsNullable(this.sizedArray, childAA.sizedArray) &&
        Objects.equals(this.requiredArray, childAA.requiredArray) &&
        Objects.equals(this.bigIntegerCode, childAA.bigIntegerCode) &&
        Objects.equals(this.integerCode, childAA.integerCode) &&
        equalsNullable(this.codes, childAA.codes) &&
        super.equals(o);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(childAAAttribute, hashCodeNullable(sizedArray), requiredArray, bigIntegerCode, integerCode, hashCodeNullable(codes), super.hashCode());
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ChildAA {\n");
    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
    sb.append("    childAAAttribute: ").append(toIndentedString(childAAAttribute)).append("\n");
    sb.append("    sizedArray: ").append(toIndentedString(sizedArray)).append("\n");
    sb.append("    requiredArray: ").append(toIndentedString(requiredArray)).append("\n");
    sb.append("    bigIntegerCode: ").append(toIndentedString(bigIntegerCode)).append("\n");
    sb.append("    integerCode: ").append(toIndentedString(integerCode)).append("\n");
    sb.append("    codes: ").append(toIndentedString(codes)).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    ");
  }

  static {
    // Initialize and register the discriminator mappings.
    Map> mappings = new HashMap<>();
    mappings.put("ChildAA", ChildAA.class);
    JSON.registerDiscriminator(ChildAA.class, "objectType", mappings);
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy