/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.Auditable;
import org.openapitools.client.model.AuditableFieldHistory;
import org.openapitools.client.model.BusinessEntity;
import org.openapitools.client.model.Contact;

/**
 * AddressBook
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class AddressBook {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Long id;

  public static final String SERIALIZED_NAME_VERSION = "version";
  @SerializedName(SERIALIZED_NAME_VERSION)
  private Integer version;

  public static final String SERIALIZED_NAME_AUDITABLE = "auditable";
  @SerializedName(SERIALIZED_NAME_AUDITABLE)
  private Auditable auditable;

  public static final String SERIALIZED_NAME_HISTORIZED = "historized";
  @SerializedName(SERIALIZED_NAME_HISTORIZED)
  private Boolean historized;

  public static final String SERIALIZED_NAME_NOTIFIED = "notified";
  @SerializedName(SERIALIZED_NAME_NOTIFIED)
  private Boolean notified;

  public static final String SERIALIZED_NAME_AUDITABLE_FIELDS = "auditableFields";
  @SerializedName(SERIALIZED_NAME_AUDITABLE_FIELDS)
  private List<AuditableFieldHistory> auditableFields = null;

  public static final String SERIALIZED_NAME_CODE = "code";
  @SerializedName(SERIALIZED_NAME_CODE)
  private String code;

  public static final String SERIALIZED_NAME_DESCRIPTION = "description";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION)
  private String description;

  public static final String SERIALIZED_NAME_APPEND_GENERATED_CODE = "appendGeneratedCode";
  @SerializedName(SERIALIZED_NAME_APPEND_GENERATED_CODE)
  private Boolean appendGeneratedCode;

  public static final String SERIALIZED_NAME_CONTACTS = "contacts";
  @SerializedName(SERIALIZED_NAME_CONTACTS)
  private List<Contact> contacts = null;

  public static final String SERIALIZED_NAME_DESCRIPTION_OR_CODE = "descriptionOrCode";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION_OR_CODE)
  private String descriptionOrCode;

  public static final String SERIALIZED_NAME_DESCRIPTION_AND_CODE = "descriptionAndCode";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION_AND_CODE)
  private String descriptionAndCode;

  public static final String SERIALIZED_NAME_REFERENCE_CODE = "referenceCode";
  @SerializedName(SERIALIZED_NAME_REFERENCE_CODE)
  private String referenceCode;

  public static final String SERIALIZED_NAME_REFERENCE_DESCRIPTION = "referenceDescription";
  @SerializedName(SERIALIZED_NAME_REFERENCE_DESCRIPTION)
  private String referenceDescription;

  public static final String SERIALIZED_NAME_CODE_CHANGED = "codeChanged";
  @SerializedName(SERIALIZED_NAME_CODE_CHANGED)
  private Boolean codeChanged;

  public static final String SERIALIZED_NAME_PARENT_ENTITY = "parentEntity";
  @SerializedName(SERIALIZED_NAME_PARENT_ENTITY)
  private BusinessEntity parentEntity;

  public static final String SERIALIZED_NAME_TRANSIENT = "transient";
  @SerializedName(SERIALIZED_NAME_TRANSIENT)
  private Boolean _transient;


  public AddressBook id(Long id) {
    
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Long getId() {
    return id;
  }



  public void setId(Long id) {
    this.id = id;
  }


  public AddressBook version(Integer version) {
    
    this.version = version;
    return this;
  }

   /**
   * Get version
   * @return version
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getVersion() {
    return version;
  }



  public void setVersion(Integer version) {
    this.version = version;
  }


  public AddressBook auditable(Auditable auditable) {
    
    this.auditable = auditable;
    return this;
  }

   /**
   * Get auditable
   * @return auditable
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Auditable getAuditable() {
    return auditable;
  }



  public void setAuditable(Auditable auditable) {
    this.auditable = auditable;
  }


  public AddressBook historized(Boolean historized) {
    
    this.historized = historized;
    return this;
  }

   /**
   * Get historized
   * @return historized
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getHistorized() {
    return historized;
  }



  public void setHistorized(Boolean historized) {
    this.historized = historized;
  }


  public AddressBook notified(Boolean notified) {
    
    this.notified = notified;
    return this;
  }

   /**
   * Get notified
   * @return notified
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getNotified() {
    return notified;
  }



  public void setNotified(Boolean notified) {
    this.notified = notified;
  }


  public AddressBook auditableFields(List<AuditableFieldHistory> auditableFields) {
    
    this.auditableFields = auditableFields;
    return this;
  }

  public AddressBook addAuditableFieldsItem(AuditableFieldHistory auditableFieldsItem) {
    if (this.auditableFields == null) {
      this.auditableFields = new ArrayList<AuditableFieldHistory>();
    }
    this.auditableFields.add(auditableFieldsItem);
    return this;
  }

   /**
   * Get auditableFields
   * @return auditableFields
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<AuditableFieldHistory> getAuditableFields() {
    return auditableFields;
  }



  public void setAuditableFields(List<AuditableFieldHistory> auditableFields) {
    this.auditableFields = auditableFields;
  }


  public AddressBook code(String code) {
    
    this.code = code;
    return this;
  }

   /**
   * Get code
   * @return code
  **/
  @ApiModelProperty(required = true, value = "")

  public String getCode() {
    return code;
  }



  public void setCode(String code) {
    this.code = code;
  }


  public AddressBook description(String description) {
    
    this.description = description;
    return this;
  }

   /**
   * Get description
   * @return description
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getDescription() {
    return description;
  }



  public void setDescription(String description) {
    this.description = description;
  }


  public AddressBook appendGeneratedCode(Boolean appendGeneratedCode) {
    
    this.appendGeneratedCode = appendGeneratedCode;
    return this;
  }

   /**
   * Get appendGeneratedCode
   * @return appendGeneratedCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getAppendGeneratedCode() {
    return appendGeneratedCode;
  }



  public void setAppendGeneratedCode(Boolean appendGeneratedCode) {
    this.appendGeneratedCode = appendGeneratedCode;
  }


  public AddressBook contacts(List<Contact> contacts) {
    
    this.contacts = contacts;
    return this;
  }

  public AddressBook addContactsItem(Contact contactsItem) {
    if (this.contacts == null) {
      this.contacts = new ArrayList<Contact>();
    }
    this.contacts.add(contactsItem);
    return this;
  }

   /**
   * Get contacts
   * @return contacts
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<Contact> getContacts() {
    return contacts;
  }



  public void setContacts(List<Contact> contacts) {
    this.contacts = contacts;
  }


  public AddressBook descriptionOrCode(String descriptionOrCode) {
    
    this.descriptionOrCode = descriptionOrCode;
    return this;
  }

   /**
   * Get descriptionOrCode
   * @return descriptionOrCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getDescriptionOrCode() {
    return descriptionOrCode;
  }



  public void setDescriptionOrCode(String descriptionOrCode) {
    this.descriptionOrCode = descriptionOrCode;
  }


  public AddressBook descriptionAndCode(String descriptionAndCode) {
    
    this.descriptionAndCode = descriptionAndCode;
    return this;
  }

   /**
   * Get descriptionAndCode
   * @return descriptionAndCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getDescriptionAndCode() {
    return descriptionAndCode;
  }



  public void setDescriptionAndCode(String descriptionAndCode) {
    this.descriptionAndCode = descriptionAndCode;
  }


  public AddressBook referenceCode(String referenceCode) {
    
    this.referenceCode = referenceCode;
    return this;
  }

   /**
   * Get referenceCode
   * @return referenceCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getReferenceCode() {
    return referenceCode;
  }



  public void setReferenceCode(String referenceCode) {
    this.referenceCode = referenceCode;
  }


  public AddressBook referenceDescription(String referenceDescription) {
    
    this.referenceDescription = referenceDescription;
    return this;
  }

   /**
   * Get referenceDescription
   * @return referenceDescription
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getReferenceDescription() {
    return referenceDescription;
  }



  public void setReferenceDescription(String referenceDescription) {
    this.referenceDescription = referenceDescription;
  }


  public AddressBook codeChanged(Boolean codeChanged) {
    
    this.codeChanged = codeChanged;
    return this;
  }

   /**
   * Get codeChanged
   * @return codeChanged
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getCodeChanged() {
    return codeChanged;
  }



  public void setCodeChanged(Boolean codeChanged) {
    this.codeChanged = codeChanged;
  }


  public AddressBook parentEntity(BusinessEntity parentEntity) {
    
    this.parentEntity = parentEntity;
    return this;
  }

   /**
   * Get parentEntity
   * @return parentEntity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public BusinessEntity getParentEntity() {
    return parentEntity;
  }



  public void setParentEntity(BusinessEntity parentEntity) {
    this.parentEntity = parentEntity;
  }


  public AddressBook _transient(Boolean _transient) {
    
    this._transient = _transient;
    return this;
  }

   /**
   * Get _transient
   * @return _transient
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getTransient() {
    return _transient;
  }



  public void setTransient(Boolean _transient) {
    this._transient = _transient;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AddressBook addressBook = (AddressBook) o;
    return Objects.equals(this.id, addressBook.id) &&
        Objects.equals(this.version, addressBook.version) &&
        Objects.equals(this.auditable, addressBook.auditable) &&
        Objects.equals(this.historized, addressBook.historized) &&
        Objects.equals(this.notified, addressBook.notified) &&
        Objects.equals(this.auditableFields, addressBook.auditableFields) &&
        Objects.equals(this.code, addressBook.code) &&
        Objects.equals(this.description, addressBook.description) &&
        Objects.equals(this.appendGeneratedCode, addressBook.appendGeneratedCode) &&
        Objects.equals(this.contacts, addressBook.contacts) &&
        Objects.equals(this.descriptionOrCode, addressBook.descriptionOrCode) &&
        Objects.equals(this.descriptionAndCode, addressBook.descriptionAndCode) &&
        Objects.equals(this.referenceCode, addressBook.referenceCode) &&
        Objects.equals(this.referenceDescription, addressBook.referenceDescription) &&
        Objects.equals(this.codeChanged, addressBook.codeChanged) &&
        Objects.equals(this.parentEntity, addressBook.parentEntity) &&
        Objects.equals(this._transient, addressBook._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, auditable, historized, notified, auditableFields, code, description, appendGeneratedCode, contacts, descriptionOrCode, descriptionAndCode, referenceCode, referenceDescription, codeChanged, parentEntity, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AddressBook {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    auditable: ").append(toIndentedString(auditable)).append("\n");
    sb.append("    historized: ").append(toIndentedString(historized)).append("\n");
    sb.append("    notified: ").append(toIndentedString(notified)).append("\n");
    sb.append("    auditableFields: ").append(toIndentedString(auditableFields)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    appendGeneratedCode: ").append(toIndentedString(appendGeneratedCode)).append("\n");
    sb.append("    contacts: ").append(toIndentedString(contacts)).append("\n");
    sb.append("    descriptionOrCode: ").append(toIndentedString(descriptionOrCode)).append("\n");
    sb.append("    descriptionAndCode: ").append(toIndentedString(descriptionAndCode)).append("\n");
    sb.append("    referenceCode: ").append(toIndentedString(referenceCode)).append("\n");
    sb.append("    referenceDescription: ").append(toIndentedString(referenceDescription)).append("\n");
    sb.append("    codeChanged: ").append(toIndentedString(codeChanged)).append("\n");
    sb.append("    parentEntity: ").append(toIndentedString(parentEntity)).append("\n");
    sb.append("    _transient: ").append(toIndentedString(_transient)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

