/*
 * 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.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.CustomFieldFormattedValueDto;
import org.openapitools.client.model.CustomFieldValueDto;
import org.openapitools.client.model.EntityReferenceDto;
import org.openapitools.client.model.LanguageDescriptionDto;
import org.threeten.bp.OffsetDateTime;

/**
 * CustomFieldDto
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class CustomFieldDto {
  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;

  /**
   * Gets or Sets fieldType
   */
  @JsonAdapter(FieldTypeEnum.Adapter.class)
  public enum FieldTypeEnum {
    STRING("STRING"),
    
    DATE("DATE"),
    
    LONG("LONG"),
    
    DOUBLE("DOUBLE"),
    
    LIST("LIST"),
    
    ENTITY("ENTITY"),
    
    TEXT_AREA("TEXT_AREA"),
    
    CHILD_ENTITY("CHILD_ENTITY"),
    
    MULTI_VALUE("MULTI_VALUE"),
    
    BOOLEAN("BOOLEAN");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

    public static class Adapter extends TypeAdapter<FieldTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final FieldTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public FieldTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return FieldTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_FIELD_TYPE = "fieldType";
  @SerializedName(SERIALIZED_NAME_FIELD_TYPE)
  private FieldTypeEnum fieldType;

  public static final String SERIALIZED_NAME_LANGUAGE_DESCRIPTIONS = "languageDescriptions";
  @SerializedName(SERIALIZED_NAME_LANGUAGE_DESCRIPTIONS)
  private List<LanguageDescriptionDto> languageDescriptions = null;

  public static final String SERIALIZED_NAME_VALUE_DATE = "valueDate";
  @SerializedName(SERIALIZED_NAME_VALUE_DATE)
  private OffsetDateTime valueDate;

  public static final String SERIALIZED_NAME_VALUE_PERIOD_START_DATE = "valuePeriodStartDate";
  @SerializedName(SERIALIZED_NAME_VALUE_PERIOD_START_DATE)
  private OffsetDateTime valuePeriodStartDate;

  public static final String SERIALIZED_NAME_VALUE_PERIOD_END_DATE = "valuePeriodEndDate";
  @SerializedName(SERIALIZED_NAME_VALUE_PERIOD_END_DATE)
  private OffsetDateTime valuePeriodEndDate;

  public static final String SERIALIZED_NAME_VALUE_PERIOD_PRIORITY = "valuePeriodPriority";
  @SerializedName(SERIALIZED_NAME_VALUE_PERIOD_PRIORITY)
  private Integer valuePeriodPriority;

  public static final String SERIALIZED_NAME_STRING_VALUE = "stringValue";
  @SerializedName(SERIALIZED_NAME_STRING_VALUE)
  private String stringValue;

  public static final String SERIALIZED_NAME_DATE_VALUE = "dateValue";
  @SerializedName(SERIALIZED_NAME_DATE_VALUE)
  private OffsetDateTime dateValue;

  public static final String SERIALIZED_NAME_LONG_VALUE = "longValue";
  @SerializedName(SERIALIZED_NAME_LONG_VALUE)
  private Long longValue;

  public static final String SERIALIZED_NAME_DOUBLE_VALUE = "doubleValue";
  @SerializedName(SERIALIZED_NAME_DOUBLE_VALUE)
  private Double doubleValue;

  public static final String SERIALIZED_NAME_BOOLEAN_VALUE = "booleanValue";
  @SerializedName(SERIALIZED_NAME_BOOLEAN_VALUE)
  private Boolean booleanValue;

  public static final String SERIALIZED_NAME_LIST_VALUE = "listValue";
  @SerializedName(SERIALIZED_NAME_LIST_VALUE)
  private List<CustomFieldValueDto> listValue = null;

  public static final String SERIALIZED_NAME_MAP_VALUE = "mapValue";
  @SerializedName(SERIALIZED_NAME_MAP_VALUE)
  private Map<String, CustomFieldValueDto> mapValue = null;

  public static final String SERIALIZED_NAME_ENTITY_REFERENCE_VALUE = "entityReferenceValue";
  @SerializedName(SERIALIZED_NAME_ENTITY_REFERENCE_VALUE)
  private EntityReferenceDto entityReferenceValue;

  public static final String SERIALIZED_NAME_VALUE_CONVERTED = "valueConverted";
  @SerializedName(SERIALIZED_NAME_VALUE_CONVERTED)
  private Object valueConverted;

  /**
   * Gets or Sets indexType
   */
  @JsonAdapter(IndexTypeEnum.Adapter.class)
  public enum IndexTypeEnum {
    STORE_ONLY("STORE_ONLY"),
    
    INDEX("INDEX"),
    
    INDEX_NOT_ANALYZE("INDEX_NOT_ANALYZE");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

    public static class Adapter extends TypeAdapter<IndexTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final IndexTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public IndexTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return IndexTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_INDEX_TYPE = "indexType";
  @SerializedName(SERIALIZED_NAME_INDEX_TYPE)
  private IndexTypeEnum indexType;

  public static final String SERIALIZED_NAME_FILE_VALUE = "fileValue";
  @SerializedName(SERIALIZED_NAME_FILE_VALUE)
  private String fileValue;

  public static final String SERIALIZED_NAME_FORMATTED_VALUE = "formattedValue";
  @SerializedName(SERIALIZED_NAME_FORMATTED_VALUE)
  private CustomFieldFormattedValueDto formattedValue;

  public static final String SERIALIZED_NAME_GUI_POSITION = "guiPosition";
  @SerializedName(SERIALIZED_NAME_GUI_POSITION)
  private String guiPosition;

  public static final String SERIALIZED_NAME_EMPTY = "empty";
  @SerializedName(SERIALIZED_NAME_EMPTY)
  private Boolean empty;


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

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

  public String getCode() {
    return code;
  }



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


  public CustomFieldDto 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 CustomFieldDto fieldType(FieldTypeEnum fieldType) {
    
    this.fieldType = fieldType;
    return this;
  }

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

  public FieldTypeEnum getFieldType() {
    return fieldType;
  }



  public void setFieldType(FieldTypeEnum fieldType) {
    this.fieldType = fieldType;
  }


  public CustomFieldDto languageDescriptions(List<LanguageDescriptionDto> languageDescriptions) {
    
    this.languageDescriptions = languageDescriptions;
    return this;
  }

  public CustomFieldDto addLanguageDescriptionsItem(LanguageDescriptionDto languageDescriptionsItem) {
    if (this.languageDescriptions == null) {
      this.languageDescriptions = new ArrayList<LanguageDescriptionDto>();
    }
    this.languageDescriptions.add(languageDescriptionsItem);
    return this;
  }

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

  public List<LanguageDescriptionDto> getLanguageDescriptions() {
    return languageDescriptions;
  }



  public void setLanguageDescriptions(List<LanguageDescriptionDto> languageDescriptions) {
    this.languageDescriptions = languageDescriptions;
  }


  public CustomFieldDto valueDate(OffsetDateTime valueDate) {
    
    this.valueDate = valueDate;
    return this;
  }

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

  public OffsetDateTime getValueDate() {
    return valueDate;
  }



  public void setValueDate(OffsetDateTime valueDate) {
    this.valueDate = valueDate;
  }


  public CustomFieldDto valuePeriodStartDate(OffsetDateTime valuePeriodStartDate) {
    
    this.valuePeriodStartDate = valuePeriodStartDate;
    return this;
  }

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

  public OffsetDateTime getValuePeriodStartDate() {
    return valuePeriodStartDate;
  }



  public void setValuePeriodStartDate(OffsetDateTime valuePeriodStartDate) {
    this.valuePeriodStartDate = valuePeriodStartDate;
  }


  public CustomFieldDto valuePeriodEndDate(OffsetDateTime valuePeriodEndDate) {
    
    this.valuePeriodEndDate = valuePeriodEndDate;
    return this;
  }

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

  public OffsetDateTime getValuePeriodEndDate() {
    return valuePeriodEndDate;
  }



  public void setValuePeriodEndDate(OffsetDateTime valuePeriodEndDate) {
    this.valuePeriodEndDate = valuePeriodEndDate;
  }


  public CustomFieldDto valuePeriodPriority(Integer valuePeriodPriority) {
    
    this.valuePeriodPriority = valuePeriodPriority;
    return this;
  }

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

  public Integer getValuePeriodPriority() {
    return valuePeriodPriority;
  }



  public void setValuePeriodPriority(Integer valuePeriodPriority) {
    this.valuePeriodPriority = valuePeriodPriority;
  }


  public CustomFieldDto stringValue(String stringValue) {
    
    this.stringValue = stringValue;
    return this;
  }

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

  public String getStringValue() {
    return stringValue;
  }



  public void setStringValue(String stringValue) {
    this.stringValue = stringValue;
  }


  public CustomFieldDto dateValue(OffsetDateTime dateValue) {
    
    this.dateValue = dateValue;
    return this;
  }

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

  public OffsetDateTime getDateValue() {
    return dateValue;
  }



  public void setDateValue(OffsetDateTime dateValue) {
    this.dateValue = dateValue;
  }


  public CustomFieldDto longValue(Long longValue) {
    
    this.longValue = longValue;
    return this;
  }

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

  public Long getLongValue() {
    return longValue;
  }



  public void setLongValue(Long longValue) {
    this.longValue = longValue;
  }


  public CustomFieldDto doubleValue(Double doubleValue) {
    
    this.doubleValue = doubleValue;
    return this;
  }

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

  public Double getDoubleValue() {
    return doubleValue;
  }



  public void setDoubleValue(Double doubleValue) {
    this.doubleValue = doubleValue;
  }


  public CustomFieldDto booleanValue(Boolean booleanValue) {
    
    this.booleanValue = booleanValue;
    return this;
  }

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

  public Boolean getBooleanValue() {
    return booleanValue;
  }



  public void setBooleanValue(Boolean booleanValue) {
    this.booleanValue = booleanValue;
  }


  public CustomFieldDto listValue(List<CustomFieldValueDto> listValue) {
    
    this.listValue = listValue;
    return this;
  }

  public CustomFieldDto addListValueItem(CustomFieldValueDto listValueItem) {
    if (this.listValue == null) {
      this.listValue = new ArrayList<CustomFieldValueDto>();
    }
    this.listValue.add(listValueItem);
    return this;
  }

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

  public List<CustomFieldValueDto> getListValue() {
    return listValue;
  }



  public void setListValue(List<CustomFieldValueDto> listValue) {
    this.listValue = listValue;
  }


  public CustomFieldDto mapValue(Map<String, CustomFieldValueDto> mapValue) {
    
    this.mapValue = mapValue;
    return this;
  }

  public CustomFieldDto putMapValueItem(String key, CustomFieldValueDto mapValueItem) {
    if (this.mapValue == null) {
      this.mapValue = new HashMap<String, CustomFieldValueDto>();
    }
    this.mapValue.put(key, mapValueItem);
    return this;
  }

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

  public Map<String, CustomFieldValueDto> getMapValue() {
    return mapValue;
  }



  public void setMapValue(Map<String, CustomFieldValueDto> mapValue) {
    this.mapValue = mapValue;
  }


  public CustomFieldDto entityReferenceValue(EntityReferenceDto entityReferenceValue) {
    
    this.entityReferenceValue = entityReferenceValue;
    return this;
  }

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

  public EntityReferenceDto getEntityReferenceValue() {
    return entityReferenceValue;
  }



  public void setEntityReferenceValue(EntityReferenceDto entityReferenceValue) {
    this.entityReferenceValue = entityReferenceValue;
  }


  public CustomFieldDto valueConverted(Object valueConverted) {
    
    this.valueConverted = valueConverted;
    return this;
  }

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

  public Object getValueConverted() {
    return valueConverted;
  }



  public void setValueConverted(Object valueConverted) {
    this.valueConverted = valueConverted;
  }


  public CustomFieldDto indexType(IndexTypeEnum indexType) {
    
    this.indexType = indexType;
    return this;
  }

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

  public IndexTypeEnum getIndexType() {
    return indexType;
  }



  public void setIndexType(IndexTypeEnum indexType) {
    this.indexType = indexType;
  }


  public CustomFieldDto fileValue(String fileValue) {
    
    this.fileValue = fileValue;
    return this;
  }

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

  public String getFileValue() {
    return fileValue;
  }



  public void setFileValue(String fileValue) {
    this.fileValue = fileValue;
  }


  public CustomFieldDto formattedValue(CustomFieldFormattedValueDto formattedValue) {
    
    this.formattedValue = formattedValue;
    return this;
  }

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

  public CustomFieldFormattedValueDto getFormattedValue() {
    return formattedValue;
  }



  public void setFormattedValue(CustomFieldFormattedValueDto formattedValue) {
    this.formattedValue = formattedValue;
  }


  public CustomFieldDto guiPosition(String guiPosition) {
    
    this.guiPosition = guiPosition;
    return this;
  }

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

  public String getGuiPosition() {
    return guiPosition;
  }



  public void setGuiPosition(String guiPosition) {
    this.guiPosition = guiPosition;
  }


  public CustomFieldDto empty(Boolean empty) {
    
    this.empty = empty;
    return this;
  }

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

  public Boolean getEmpty() {
    return empty;
  }



  public void setEmpty(Boolean empty) {
    this.empty = empty;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CustomFieldDto customFieldDto = (CustomFieldDto) o;
    return Objects.equals(this.code, customFieldDto.code) &&
        Objects.equals(this.description, customFieldDto.description) &&
        Objects.equals(this.fieldType, customFieldDto.fieldType) &&
        Objects.equals(this.languageDescriptions, customFieldDto.languageDescriptions) &&
        Objects.equals(this.valueDate, customFieldDto.valueDate) &&
        Objects.equals(this.valuePeriodStartDate, customFieldDto.valuePeriodStartDate) &&
        Objects.equals(this.valuePeriodEndDate, customFieldDto.valuePeriodEndDate) &&
        Objects.equals(this.valuePeriodPriority, customFieldDto.valuePeriodPriority) &&
        Objects.equals(this.stringValue, customFieldDto.stringValue) &&
        Objects.equals(this.dateValue, customFieldDto.dateValue) &&
        Objects.equals(this.longValue, customFieldDto.longValue) &&
        Objects.equals(this.doubleValue, customFieldDto.doubleValue) &&
        Objects.equals(this.booleanValue, customFieldDto.booleanValue) &&
        Objects.equals(this.listValue, customFieldDto.listValue) &&
        Objects.equals(this.mapValue, customFieldDto.mapValue) &&
        Objects.equals(this.entityReferenceValue, customFieldDto.entityReferenceValue) &&
        Objects.equals(this.valueConverted, customFieldDto.valueConverted) &&
        Objects.equals(this.indexType, customFieldDto.indexType) &&
        Objects.equals(this.fileValue, customFieldDto.fileValue) &&
        Objects.equals(this.formattedValue, customFieldDto.formattedValue) &&
        Objects.equals(this.guiPosition, customFieldDto.guiPosition) &&
        Objects.equals(this.empty, customFieldDto.empty);
  }

  @Override
  public int hashCode() {
    return Objects.hash(code, description, fieldType, languageDescriptions, valueDate, valuePeriodStartDate, valuePeriodEndDate, valuePeriodPriority, stringValue, dateValue, longValue, doubleValue, booleanValue, listValue, mapValue, entityReferenceValue, valueConverted, indexType, fileValue, formattedValue, guiPosition, empty);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CustomFieldDto {\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    fieldType: ").append(toIndentedString(fieldType)).append("\n");
    sb.append("    languageDescriptions: ").append(toIndentedString(languageDescriptions)).append("\n");
    sb.append("    valueDate: ").append(toIndentedString(valueDate)).append("\n");
    sb.append("    valuePeriodStartDate: ").append(toIndentedString(valuePeriodStartDate)).append("\n");
    sb.append("    valuePeriodEndDate: ").append(toIndentedString(valuePeriodEndDate)).append("\n");
    sb.append("    valuePeriodPriority: ").append(toIndentedString(valuePeriodPriority)).append("\n");
    sb.append("    stringValue: ").append(toIndentedString(stringValue)).append("\n");
    sb.append("    dateValue: ").append(toIndentedString(dateValue)).append("\n");
    sb.append("    longValue: ").append(toIndentedString(longValue)).append("\n");
    sb.append("    doubleValue: ").append(toIndentedString(doubleValue)).append("\n");
    sb.append("    booleanValue: ").append(toIndentedString(booleanValue)).append("\n");
    sb.append("    listValue: ").append(toIndentedString(listValue)).append("\n");
    sb.append("    mapValue: ").append(toIndentedString(mapValue)).append("\n");
    sb.append("    entityReferenceValue: ").append(toIndentedString(entityReferenceValue)).append("\n");
    sb.append("    valueConverted: ").append(toIndentedString(valueConverted)).append("\n");
    sb.append("    indexType: ").append(toIndentedString(indexType)).append("\n");
    sb.append("    fileValue: ").append(toIndentedString(fileValue)).append("\n");
    sb.append("    formattedValue: ").append(toIndentedString(formattedValue)).append("\n");
    sb.append("    guiPosition: ").append(toIndentedString(guiPosition)).append("\n");
    sb.append("    empty: ").append(toIndentedString(empty)).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    ");
  }

}

