java/src/main/java/com/konfigthis/dojah/client/model/GetAccountAnalysisResponseEntityInflowBreakdown.java
/*
 * DOJAH APIs
 * Use Dojah to verify, onboard and manage user identity across Africa!
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.dojah.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 org.openapitools.jackson.nullable.JsonNullable;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.konfigthis.dojah.client.JSON;

/**
 * GetAccountAnalysisResponseEntityInflowBreakdown
 */
@javax.annotation.Generated(value = "Generated by https://konfigthis.com")
public class GetAccountAnalysisResponseEntityInflowBreakdown {
  public static final String SERIALIZED_NAME_ADDITIONAL_INCOME = "AdditionalIncome";
  @SerializedName(SERIALIZED_NAME_ADDITIONAL_INCOME)
  private String additionalIncome;

  public static final String SERIALIZED_NAME_RECURRING_SALARY_PAYMENTS = "RecurringSalaryPayments";
  @SerializedName(SERIALIZED_NAME_RECURRING_SALARY_PAYMENTS)
  private String recurringSalaryPayments;

  public static final String SERIALIZED_NAME_A_SALARY_EARNER = "aSalaryEarner";
  @SerializedName(SERIALIZED_NAME_A_SALARY_EARNER)
  private String aSalaryEarner;

  public static final String SERIALIZED_NAME_AVERAGE_ADDITIONAL_INCOME = "averageAdditionalIncome";
  @SerializedName(SERIALIZED_NAME_AVERAGE_ADDITIONAL_INCOME)
  private Double averageAdditionalIncome;

  public static final String SERIALIZED_NAME_AVERAGE_GUARANTEED_SALARY = "averageGuaranteedSalary";
  @SerializedName(SERIALIZED_NAME_AVERAGE_GUARANTEED_SALARY)
  private Double averageGuaranteedSalary;

  public static final String SERIALIZED_NAME_ESTIMATED_SALARY_PAYMENT_DAY = "estimatedSalaryPaymentDay";
  @SerializedName(SERIALIZED_NAME_ESTIMATED_SALARY_PAYMENT_DAY)
  private String estimatedSalaryPaymentDay;

  public static final String SERIALIZED_NAME_LAST_DATE_OF_SALARY_PAYMENT = "lastDateOfSalaryPayment";
  @SerializedName(SERIALIZED_NAME_LAST_DATE_OF_SALARY_PAYMENT)
  private String lastDateOfSalaryPayment;

  public static final String SERIALIZED_NAME_MINIMUM_SALARY = "minimumSalary";
  @SerializedName(SERIALIZED_NAME_MINIMUM_SALARY)
  private Double minimumSalary;

  public static final String SERIALIZED_NAME_NET_AVERAGE_MONTHLY_SALARY = "netAverageMonthlySalary";
  @SerializedName(SERIALIZED_NAME_NET_AVERAGE_MONTHLY_SALARY)
  private Double netAverageMonthlySalary;

  public static final String SERIALIZED_NAME_NUMBER_OF_ADDITIONAL_INCOME_PAYMENTS = "numberOfAdditionalIncomePayments";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_ADDITIONAL_INCOME_PAYMENTS)
  private Double numberOfAdditionalIncomePayments;

  public static final String SERIALIZED_NAME_TOTALNUMBER_OF_SALARY_PAYMENTS = "totalnumberOfSalaryPayments";
  @SerializedName(SERIALIZED_NAME_TOTALNUMBER_OF_SALARY_PAYMENTS)
  private Double totalnumberOfSalaryPayments;

  public GetAccountAnalysisResponseEntityInflowBreakdown() {
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown additionalIncome(String additionalIncome) {

    
    
    
    
    this.additionalIncome = additionalIncome;
    return this;
  }

   /**
   * Get additionalIncome
   * @return additionalIncome
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "true", value = "")

  public String getAdditionalIncome() {
    return additionalIncome;
  }


  public void setAdditionalIncome(String additionalIncome) {

    
    
    
    this.additionalIncome = additionalIncome;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown recurringSalaryPayments(String recurringSalaryPayments) {

    
    
    
    
    this.recurringSalaryPayments = recurringSalaryPayments;
    return this;
  }

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

  public String getRecurringSalaryPayments() {
    return recurringSalaryPayments;
  }


  public void setRecurringSalaryPayments(String recurringSalaryPayments) {

    
    
    
    this.recurringSalaryPayments = recurringSalaryPayments;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown aSalaryEarner(String aSalaryEarner) {

    
    
    
    
    this.aSalaryEarner = aSalaryEarner;
    return this;
  }

   /**
   * Get aSalaryEarner
   * @return aSalaryEarner
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "false", value = "")

  public String getaSalaryEarner() {
    return aSalaryEarner;
  }


  public void setaSalaryEarner(String aSalaryEarner) {

    
    
    
    this.aSalaryEarner = aSalaryEarner;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown averageAdditionalIncome(Double averageAdditionalIncome) {

    
    
    
    
    this.averageAdditionalIncome = averageAdditionalIncome;
    return this;
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown averageAdditionalIncome(Integer averageAdditionalIncome) {

    
    
    
    
    this.averageAdditionalIncome = averageAdditionalIncome.doubleValue();
    return this;
  }

   /**
   * Get averageAdditionalIncome
   * @return averageAdditionalIncome
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "9166.67", value = "")

  public Double getAverageAdditionalIncome() {
    return averageAdditionalIncome;
  }


  public void setAverageAdditionalIncome(Double averageAdditionalIncome) {

    
    
    
    this.averageAdditionalIncome = averageAdditionalIncome;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown averageGuaranteedSalary(Double averageGuaranteedSalary) {

    
    
    
    
    this.averageGuaranteedSalary = averageGuaranteedSalary;
    return this;
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown averageGuaranteedSalary(Integer averageGuaranteedSalary) {

    
    
    
    
    this.averageGuaranteedSalary = averageGuaranteedSalary.doubleValue();
    return this;
  }

   /**
   * Get averageGuaranteedSalary
   * @return averageGuaranteedSalary
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Double getAverageGuaranteedSalary() {
    return averageGuaranteedSalary;
  }


  public void setAverageGuaranteedSalary(Double averageGuaranteedSalary) {

    
    
    
    this.averageGuaranteedSalary = averageGuaranteedSalary;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown estimatedSalaryPaymentDay(String estimatedSalaryPaymentDay) {

    
    
    
    
    this.estimatedSalaryPaymentDay = estimatedSalaryPaymentDay;
    return this;
  }

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

  public String getEstimatedSalaryPaymentDay() {
    return estimatedSalaryPaymentDay;
  }


  public void setEstimatedSalaryPaymentDay(String estimatedSalaryPaymentDay) {

    
    
    
    this.estimatedSalaryPaymentDay = estimatedSalaryPaymentDay;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown lastDateOfSalaryPayment(String lastDateOfSalaryPayment) {

    
    
    
    
    this.lastDateOfSalaryPayment = lastDateOfSalaryPayment;
    return this;
  }

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

  public String getLastDateOfSalaryPayment() {
    return lastDateOfSalaryPayment;
  }


  public void setLastDateOfSalaryPayment(String lastDateOfSalaryPayment) {

    
    
    
    this.lastDateOfSalaryPayment = lastDateOfSalaryPayment;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown minimumSalary(Double minimumSalary) {

    
    
    
    
    this.minimumSalary = minimumSalary;
    return this;
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown minimumSalary(Integer minimumSalary) {

    
    
    
    
    this.minimumSalary = minimumSalary.doubleValue();
    return this;
  }

   /**
   * Get minimumSalary
   * @return minimumSalary
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Double getMinimumSalary() {
    return minimumSalary;
  }


  public void setMinimumSalary(Double minimumSalary) {

    
    
    
    this.minimumSalary = minimumSalary;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown netAverageMonthlySalary(Double netAverageMonthlySalary) {

    
    
    
    
    this.netAverageMonthlySalary = netAverageMonthlySalary;
    return this;
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown netAverageMonthlySalary(Integer netAverageMonthlySalary) {

    
    
    
    
    this.netAverageMonthlySalary = netAverageMonthlySalary.doubleValue();
    return this;
  }

   /**
   * Get netAverageMonthlySalary
   * @return netAverageMonthlySalary
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Double getNetAverageMonthlySalary() {
    return netAverageMonthlySalary;
  }


  public void setNetAverageMonthlySalary(Double netAverageMonthlySalary) {

    
    
    
    this.netAverageMonthlySalary = netAverageMonthlySalary;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown numberOfAdditionalIncomePayments(Double numberOfAdditionalIncomePayments) {

    
    
    
    
    this.numberOfAdditionalIncomePayments = numberOfAdditionalIncomePayments;
    return this;
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown numberOfAdditionalIncomePayments(Integer numberOfAdditionalIncomePayments) {

    
    
    
    
    this.numberOfAdditionalIncomePayments = numberOfAdditionalIncomePayments.doubleValue();
    return this;
  }

   /**
   * Get numberOfAdditionalIncomePayments
   * @return numberOfAdditionalIncomePayments
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2", value = "")

  public Double getNumberOfAdditionalIncomePayments() {
    return numberOfAdditionalIncomePayments;
  }


  public void setNumberOfAdditionalIncomePayments(Double numberOfAdditionalIncomePayments) {

    
    
    
    this.numberOfAdditionalIncomePayments = numberOfAdditionalIncomePayments;
  }


  public GetAccountAnalysisResponseEntityInflowBreakdown totalnumberOfSalaryPayments(Double totalnumberOfSalaryPayments) {

    
    
    
    
    this.totalnumberOfSalaryPayments = totalnumberOfSalaryPayments;
    return this;
  }

  public GetAccountAnalysisResponseEntityInflowBreakdown totalnumberOfSalaryPayments(Integer totalnumberOfSalaryPayments) {

    
    
    
    
    this.totalnumberOfSalaryPayments = totalnumberOfSalaryPayments.doubleValue();
    return this;
  }

   /**
   * Get totalnumberOfSalaryPayments
   * @return totalnumberOfSalaryPayments
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Double getTotalnumberOfSalaryPayments() {
    return totalnumberOfSalaryPayments;
  }


  public void setTotalnumberOfSalaryPayments(Double totalnumberOfSalaryPayments) {

    
    
    
    this.totalnumberOfSalaryPayments = totalnumberOfSalaryPayments;
  }

  /**
   * A container for additional, undeclared properties.
   * This is a holder for any undeclared properties as specified with
   * the 'additionalProperties' keyword in the OAS document.
   */
  private Map<String, Object> additionalProperties;

  /**
   * Set the additional (undeclared) property with the specified name and value.
   * If the property does not already exist, create it otherwise replace it.
   *
   * @param key name of the property
   * @param value value of the property
   * @return the GetAccountAnalysisResponseEntityInflowBreakdown instance itself
   */
  public GetAccountAnalysisResponseEntityInflowBreakdown putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap<String, Object>();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map<String, Object> getAdditionalProperties() {
    return additionalProperties;
  }

  /**
   * Return the additional (undeclared) property with the specified name.
   *
   * @param key name of the property
   * @return an object
   */
  public Object getAdditionalProperty(String key) {
    if (this.additionalProperties == null) {
        return null;
    }
    return this.additionalProperties.get(key);
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GetAccountAnalysisResponseEntityInflowBreakdown getAccountAnalysisResponseEntityInflowBreakdown = (GetAccountAnalysisResponseEntityInflowBreakdown) o;
    return Objects.equals(this.additionalIncome, getAccountAnalysisResponseEntityInflowBreakdown.additionalIncome) &&
        Objects.equals(this.recurringSalaryPayments, getAccountAnalysisResponseEntityInflowBreakdown.recurringSalaryPayments) &&
        Objects.equals(this.aSalaryEarner, getAccountAnalysisResponseEntityInflowBreakdown.aSalaryEarner) &&
        Objects.equals(this.averageAdditionalIncome, getAccountAnalysisResponseEntityInflowBreakdown.averageAdditionalIncome) &&
        Objects.equals(this.averageGuaranteedSalary, getAccountAnalysisResponseEntityInflowBreakdown.averageGuaranteedSalary) &&
        Objects.equals(this.estimatedSalaryPaymentDay, getAccountAnalysisResponseEntityInflowBreakdown.estimatedSalaryPaymentDay) &&
        Objects.equals(this.lastDateOfSalaryPayment, getAccountAnalysisResponseEntityInflowBreakdown.lastDateOfSalaryPayment) &&
        Objects.equals(this.minimumSalary, getAccountAnalysisResponseEntityInflowBreakdown.minimumSalary) &&
        Objects.equals(this.netAverageMonthlySalary, getAccountAnalysisResponseEntityInflowBreakdown.netAverageMonthlySalary) &&
        Objects.equals(this.numberOfAdditionalIncomePayments, getAccountAnalysisResponseEntityInflowBreakdown.numberOfAdditionalIncomePayments) &&
        Objects.equals(this.totalnumberOfSalaryPayments, getAccountAnalysisResponseEntityInflowBreakdown.totalnumberOfSalaryPayments)&&
        Objects.equals(this.additionalProperties, getAccountAnalysisResponseEntityInflowBreakdown.additionalProperties);
  }

  private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> 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(additionalIncome, recurringSalaryPayments, aSalaryEarner, averageAdditionalIncome, averageGuaranteedSalary, estimatedSalaryPaymentDay, lastDateOfSalaryPayment, minimumSalary, netAverageMonthlySalary, numberOfAdditionalIncomePayments, totalnumberOfSalaryPayments, additionalProperties);
  }

  private static <T> int hashCodeNullable(JsonNullable<T> 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 GetAccountAnalysisResponseEntityInflowBreakdown {\n");
    sb.append("    additionalIncome: ").append(toIndentedString(additionalIncome)).append("\n");
    sb.append("    recurringSalaryPayments: ").append(toIndentedString(recurringSalaryPayments)).append("\n");
    sb.append("    aSalaryEarner: ").append(toIndentedString(aSalaryEarner)).append("\n");
    sb.append("    averageAdditionalIncome: ").append(toIndentedString(averageAdditionalIncome)).append("\n");
    sb.append("    averageGuaranteedSalary: ").append(toIndentedString(averageGuaranteedSalary)).append("\n");
    sb.append("    estimatedSalaryPaymentDay: ").append(toIndentedString(estimatedSalaryPaymentDay)).append("\n");
    sb.append("    lastDateOfSalaryPayment: ").append(toIndentedString(lastDateOfSalaryPayment)).append("\n");
    sb.append("    minimumSalary: ").append(toIndentedString(minimumSalary)).append("\n");
    sb.append("    netAverageMonthlySalary: ").append(toIndentedString(netAverageMonthlySalary)).append("\n");
    sb.append("    numberOfAdditionalIncomePayments: ").append(toIndentedString(numberOfAdditionalIncomePayments)).append("\n");
    sb.append("    totalnumberOfSalaryPayments: ").append(toIndentedString(totalnumberOfSalaryPayments)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).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    ");
  }


  public static HashSet<String> openapiFields;
  public static HashSet<String> openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet<String>();
    openapiFields.add("AdditionalIncome");
    openapiFields.add("RecurringSalaryPayments");
    openapiFields.add("aSalaryEarner");
    openapiFields.add("averageAdditionalIncome");
    openapiFields.add("averageGuaranteedSalary");
    openapiFields.add("estimatedSalaryPaymentDay");
    openapiFields.add("lastDateOfSalaryPayment");
    openapiFields.add("minimumSalary");
    openapiFields.add("netAverageMonthlySalary");
    openapiFields.add("numberOfAdditionalIncomePayments");
    openapiFields.add("totalnumberOfSalaryPayments");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet<String>();
  }

 /**
  * Validates the JSON Object and throws an exception if issues found
  *
  * @param jsonObj JSON Object
  * @throws IOException if the JSON Object is invalid with respect to GetAccountAnalysisResponseEntityInflowBreakdown
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (!GetAccountAnalysisResponseEntityInflowBreakdown.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountAnalysisResponseEntityInflowBreakdown is not found in the empty JSON string", GetAccountAnalysisResponseEntityInflowBreakdown.openapiRequiredFields.toString()));
        }
      }
      if ((jsonObj.get("AdditionalIncome") != null && !jsonObj.get("AdditionalIncome").isJsonNull()) && !jsonObj.get("AdditionalIncome").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AdditionalIncome` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AdditionalIncome").toString()));
      }
      if (!jsonObj.get("RecurringSalaryPayments").isJsonNull() && (jsonObj.get("RecurringSalaryPayments") != null && !jsonObj.get("RecurringSalaryPayments").isJsonNull()) && !jsonObj.get("RecurringSalaryPayments").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `RecurringSalaryPayments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecurringSalaryPayments").toString()));
      }
      if ((jsonObj.get("aSalaryEarner") != null && !jsonObj.get("aSalaryEarner").isJsonNull()) && !jsonObj.get("aSalaryEarner").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `aSalaryEarner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aSalaryEarner").toString()));
      }
      if (!jsonObj.get("estimatedSalaryPaymentDay").isJsonNull() && (jsonObj.get("estimatedSalaryPaymentDay") != null && !jsonObj.get("estimatedSalaryPaymentDay").isJsonNull()) && !jsonObj.get("estimatedSalaryPaymentDay").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `estimatedSalaryPaymentDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("estimatedSalaryPaymentDay").toString()));
      }
      if (!jsonObj.get("lastDateOfSalaryPayment").isJsonNull() && (jsonObj.get("lastDateOfSalaryPayment") != null && !jsonObj.get("lastDateOfSalaryPayment").isJsonNull()) && !jsonObj.get("lastDateOfSalaryPayment").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `lastDateOfSalaryPayment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastDateOfSalaryPayment").toString()));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
       if (!GetAccountAnalysisResponseEntityInflowBreakdown.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'GetAccountAnalysisResponseEntityInflowBreakdown' and its subtypes
       }
       final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter<GetAccountAnalysisResponseEntityInflowBreakdown> thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAnalysisResponseEntityInflowBreakdown.class));

       return (TypeAdapter<T>) new TypeAdapter<GetAccountAnalysisResponseEntityInflowBreakdown>() {
           @Override
           public void write(JsonWriter out, GetAccountAnalysisResponseEntityInflowBreakdown value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additonal properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
                 if (entry.getValue() instanceof String)
                   obj.addProperty(entry.getKey(), (String) entry.getValue());
                 else if (entry.getValue() instanceof Number)
                   obj.addProperty(entry.getKey(), (Number) entry.getValue());
                 else if (entry.getValue() instanceof Boolean)
                   obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                 else if (entry.getValue() instanceof Character)
                   obj.addProperty(entry.getKey(), (Character) entry.getValue());
                 else {
                   obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
                 }
               }
             }
             elementAdapter.write(out, obj);
           }

           @Override
           public GetAccountAnalysisResponseEntityInflowBreakdown read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             GetAccountAnalysisResponseEntityInflowBreakdown instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
               if (!openapiFields.contains(entry.getKey())) {
                 if (entry.getValue().isJsonPrimitive()) { // primitive type
                   if (entry.getValue().getAsJsonPrimitive().isString())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                   else if (entry.getValue().getAsJsonPrimitive().isNumber())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                   else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                   else
                     throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                 } else if (entry.getValue().isJsonArray()) {
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
                 } else { // JSON object
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                 }
               }
             }
             return instance;
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of GetAccountAnalysisResponseEntityInflowBreakdown given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of GetAccountAnalysisResponseEntityInflowBreakdown
  * @throws IOException if the JSON string is invalid with respect to GetAccountAnalysisResponseEntityInflowBreakdown
  */
  public static GetAccountAnalysisResponseEntityInflowBreakdown fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, GetAccountAnalysisResponseEntityInflowBreakdown.class);
  }

 /**
  * Convert an instance of GetAccountAnalysisResponseEntityInflowBreakdown to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}

