/*
 * Lethean Blockchain API
 * OpenAPI for Lethean Blockchain
 *
 * The version of the OpenAPI document: 6.0.1
 * 
 *
 * 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.Locale;
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 java.io.IOException;
import java.util.Arrays;

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 com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Locale;

import invalidPackageName.JSON;

/**
 * TxPoolPerformanceModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class TxPoolPerformanceModel {
  public static final String SERIALIZED_NAME_TX_PROCESSING_TIME = "tx_processing_time";
  @SerializedName(SERIALIZED_NAME_TX_PROCESSING_TIME)
  @javax.annotation.Nullable
  private Integer txProcessingTime;

  public static final String SERIALIZED_NAME_CHECK_INPUTS_TYPES_SUPPORTED_TIME = "check_inputs_types_supported_time";
  @SerializedName(SERIALIZED_NAME_CHECK_INPUTS_TYPES_SUPPORTED_TIME)
  @javax.annotation.Nullable
  private Integer checkInputsTypesSupportedTime;

  public static final String SERIALIZED_NAME_EXPIRATION_VALIDATE_TIME = "expiration_validate_time";
  @SerializedName(SERIALIZED_NAME_EXPIRATION_VALIDATE_TIME)
  @javax.annotation.Nullable
  private Integer expirationValidateTime;

  public static final String SERIALIZED_NAME_VALIDATE_AMOUNT_TIME = "validate_amount_time";
  @SerializedName(SERIALIZED_NAME_VALIDATE_AMOUNT_TIME)
  @javax.annotation.Nullable
  private Integer validateAmountTime;

  public static final String SERIALIZED_NAME_VALIDATE_ALIAS_TIME = "validate_alias_time";
  @SerializedName(SERIALIZED_NAME_VALIDATE_ALIAS_TIME)
  @javax.annotation.Nullable
  private Integer validateAliasTime;

  public static final String SERIALIZED_NAME_CHECK_KEYIMAGES_WS_MS_TIME = "check_keyimages_ws_ms_time";
  @SerializedName(SERIALIZED_NAME_CHECK_KEYIMAGES_WS_MS_TIME)
  @javax.annotation.Nullable
  private Integer checkKeyimagesWsMsTime;

  public static final String SERIALIZED_NAME_CHECK_INPUTS_TIME = "check_inputs_time";
  @SerializedName(SERIALIZED_NAME_CHECK_INPUTS_TIME)
  @javax.annotation.Nullable
  private Integer checkInputsTime;

  public static final String SERIALIZED_NAME_BEGIN_TX_TIME = "begin_tx_time";
  @SerializedName(SERIALIZED_NAME_BEGIN_TX_TIME)
  @javax.annotation.Nullable
  private Integer beginTxTime;

  public static final String SERIALIZED_NAME_UPDATE_DB_TIME = "update_db_time";
  @SerializedName(SERIALIZED_NAME_UPDATE_DB_TIME)
  @javax.annotation.Nullable
  private Integer updateDbTime;

  public static final String SERIALIZED_NAME_DB_COMMIT_TIME = "db_commit_time";
  @SerializedName(SERIALIZED_NAME_DB_COMMIT_TIME)
  @javax.annotation.Nullable
  private Integer dbCommitTime;

  public static final String SERIALIZED_NAME_CHECK_POST_HF4_BALANCE = "check_post_hf4_balance";
  @SerializedName(SERIALIZED_NAME_CHECK_POST_HF4_BALANCE)
  @javax.annotation.Nullable
  private Integer checkPostHf4Balance;

  public TxPoolPerformanceModel() {
  }

  public TxPoolPerformanceModel txProcessingTime(@javax.annotation.Nullable Integer txProcessingTime) {
    this.txProcessingTime = txProcessingTime;
    return this;
  }

  /**
   * Get txProcessingTime
   * @return txProcessingTime
   */
  @javax.annotation.Nullable
  public Integer getTxProcessingTime() {
    return txProcessingTime;
  }

  public void setTxProcessingTime(@javax.annotation.Nullable Integer txProcessingTime) {
    this.txProcessingTime = txProcessingTime;
  }


  public TxPoolPerformanceModel checkInputsTypesSupportedTime(@javax.annotation.Nullable Integer checkInputsTypesSupportedTime) {
    this.checkInputsTypesSupportedTime = checkInputsTypesSupportedTime;
    return this;
  }

  /**
   * Get checkInputsTypesSupportedTime
   * @return checkInputsTypesSupportedTime
   */
  @javax.annotation.Nullable
  public Integer getCheckInputsTypesSupportedTime() {
    return checkInputsTypesSupportedTime;
  }

  public void setCheckInputsTypesSupportedTime(@javax.annotation.Nullable Integer checkInputsTypesSupportedTime) {
    this.checkInputsTypesSupportedTime = checkInputsTypesSupportedTime;
  }


  public TxPoolPerformanceModel expirationValidateTime(@javax.annotation.Nullable Integer expirationValidateTime) {
    this.expirationValidateTime = expirationValidateTime;
    return this;
  }

  /**
   * Get expirationValidateTime
   * @return expirationValidateTime
   */
  @javax.annotation.Nullable
  public Integer getExpirationValidateTime() {
    return expirationValidateTime;
  }

  public void setExpirationValidateTime(@javax.annotation.Nullable Integer expirationValidateTime) {
    this.expirationValidateTime = expirationValidateTime;
  }


  public TxPoolPerformanceModel validateAmountTime(@javax.annotation.Nullable Integer validateAmountTime) {
    this.validateAmountTime = validateAmountTime;
    return this;
  }

  /**
   * Get validateAmountTime
   * @return validateAmountTime
   */
  @javax.annotation.Nullable
  public Integer getValidateAmountTime() {
    return validateAmountTime;
  }

  public void setValidateAmountTime(@javax.annotation.Nullable Integer validateAmountTime) {
    this.validateAmountTime = validateAmountTime;
  }


  public TxPoolPerformanceModel validateAliasTime(@javax.annotation.Nullable Integer validateAliasTime) {
    this.validateAliasTime = validateAliasTime;
    return this;
  }

  /**
   * Get validateAliasTime
   * @return validateAliasTime
   */
  @javax.annotation.Nullable
  public Integer getValidateAliasTime() {
    return validateAliasTime;
  }

  public void setValidateAliasTime(@javax.annotation.Nullable Integer validateAliasTime) {
    this.validateAliasTime = validateAliasTime;
  }


  public TxPoolPerformanceModel checkKeyimagesWsMsTime(@javax.annotation.Nullable Integer checkKeyimagesWsMsTime) {
    this.checkKeyimagesWsMsTime = checkKeyimagesWsMsTime;
    return this;
  }

  /**
   * Get checkKeyimagesWsMsTime
   * @return checkKeyimagesWsMsTime
   */
  @javax.annotation.Nullable
  public Integer getCheckKeyimagesWsMsTime() {
    return checkKeyimagesWsMsTime;
  }

  public void setCheckKeyimagesWsMsTime(@javax.annotation.Nullable Integer checkKeyimagesWsMsTime) {
    this.checkKeyimagesWsMsTime = checkKeyimagesWsMsTime;
  }


  public TxPoolPerformanceModel checkInputsTime(@javax.annotation.Nullable Integer checkInputsTime) {
    this.checkInputsTime = checkInputsTime;
    return this;
  }

  /**
   * Get checkInputsTime
   * @return checkInputsTime
   */
  @javax.annotation.Nullable
  public Integer getCheckInputsTime() {
    return checkInputsTime;
  }

  public void setCheckInputsTime(@javax.annotation.Nullable Integer checkInputsTime) {
    this.checkInputsTime = checkInputsTime;
  }


  public TxPoolPerformanceModel beginTxTime(@javax.annotation.Nullable Integer beginTxTime) {
    this.beginTxTime = beginTxTime;
    return this;
  }

  /**
   * Get beginTxTime
   * @return beginTxTime
   */
  @javax.annotation.Nullable
  public Integer getBeginTxTime() {
    return beginTxTime;
  }

  public void setBeginTxTime(@javax.annotation.Nullable Integer beginTxTime) {
    this.beginTxTime = beginTxTime;
  }


  public TxPoolPerformanceModel updateDbTime(@javax.annotation.Nullable Integer updateDbTime) {
    this.updateDbTime = updateDbTime;
    return this;
  }

  /**
   * Get updateDbTime
   * @return updateDbTime
   */
  @javax.annotation.Nullable
  public Integer getUpdateDbTime() {
    return updateDbTime;
  }

  public void setUpdateDbTime(@javax.annotation.Nullable Integer updateDbTime) {
    this.updateDbTime = updateDbTime;
  }


  public TxPoolPerformanceModel dbCommitTime(@javax.annotation.Nullable Integer dbCommitTime) {
    this.dbCommitTime = dbCommitTime;
    return this;
  }

  /**
   * Get dbCommitTime
   * @return dbCommitTime
   */
  @javax.annotation.Nullable
  public Integer getDbCommitTime() {
    return dbCommitTime;
  }

  public void setDbCommitTime(@javax.annotation.Nullable Integer dbCommitTime) {
    this.dbCommitTime = dbCommitTime;
  }


  public TxPoolPerformanceModel checkPostHf4Balance(@javax.annotation.Nullable Integer checkPostHf4Balance) {
    this.checkPostHf4Balance = checkPostHf4Balance;
    return this;
  }

  /**
   * Get checkPostHf4Balance
   * @return checkPostHf4Balance
   */
  @javax.annotation.Nullable
  public Integer getCheckPostHf4Balance() {
    return checkPostHf4Balance;
  }

  public void setCheckPostHf4Balance(@javax.annotation.Nullable Integer checkPostHf4Balance) {
    this.checkPostHf4Balance = checkPostHf4Balance;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    TxPoolPerformanceModel txPoolPerformanceModel = (TxPoolPerformanceModel) o;
    return Objects.equals(this.txProcessingTime, txPoolPerformanceModel.txProcessingTime) &&
        Objects.equals(this.checkInputsTypesSupportedTime, txPoolPerformanceModel.checkInputsTypesSupportedTime) &&
        Objects.equals(this.expirationValidateTime, txPoolPerformanceModel.expirationValidateTime) &&
        Objects.equals(this.validateAmountTime, txPoolPerformanceModel.validateAmountTime) &&
        Objects.equals(this.validateAliasTime, txPoolPerformanceModel.validateAliasTime) &&
        Objects.equals(this.checkKeyimagesWsMsTime, txPoolPerformanceModel.checkKeyimagesWsMsTime) &&
        Objects.equals(this.checkInputsTime, txPoolPerformanceModel.checkInputsTime) &&
        Objects.equals(this.beginTxTime, txPoolPerformanceModel.beginTxTime) &&
        Objects.equals(this.updateDbTime, txPoolPerformanceModel.updateDbTime) &&
        Objects.equals(this.dbCommitTime, txPoolPerformanceModel.dbCommitTime) &&
        Objects.equals(this.checkPostHf4Balance, txPoolPerformanceModel.checkPostHf4Balance);
  }

  @Override
  public int hashCode() {
    return Objects.hash(txProcessingTime, checkInputsTypesSupportedTime, expirationValidateTime, validateAmountTime, validateAliasTime, checkKeyimagesWsMsTime, checkInputsTime, beginTxTime, updateDbTime, dbCommitTime, checkPostHf4Balance);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class TxPoolPerformanceModel {\n");
    sb.append("    txProcessingTime: ").append(toIndentedString(txProcessingTime)).append("\n");
    sb.append("    checkInputsTypesSupportedTime: ").append(toIndentedString(checkInputsTypesSupportedTime)).append("\n");
    sb.append("    expirationValidateTime: ").append(toIndentedString(expirationValidateTime)).append("\n");
    sb.append("    validateAmountTime: ").append(toIndentedString(validateAmountTime)).append("\n");
    sb.append("    validateAliasTime: ").append(toIndentedString(validateAliasTime)).append("\n");
    sb.append("    checkKeyimagesWsMsTime: ").append(toIndentedString(checkKeyimagesWsMsTime)).append("\n");
    sb.append("    checkInputsTime: ").append(toIndentedString(checkInputsTime)).append("\n");
    sb.append("    beginTxTime: ").append(toIndentedString(beginTxTime)).append("\n");
    sb.append("    updateDbTime: ").append(toIndentedString(updateDbTime)).append("\n");
    sb.append("    dbCommitTime: ").append(toIndentedString(dbCommitTime)).append("\n");
    sb.append("    checkPostHf4Balance: ").append(toIndentedString(checkPostHf4Balance)).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>(Arrays.asList("tx_processing_time", "check_inputs_types_supported_time", "expiration_validate_time", "validate_amount_time", "validate_alias_time", "check_keyimages_ws_ms_time", "check_inputs_time", "begin_tx_time", "update_db_time", "db_commit_time", "check_post_hf4_balance"));

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

  /**
   * Validates the JSON Element and throws an exception if issues found
   *
   * @param jsonElement JSON Element
   * @throws IOException if the JSON Element is invalid with respect to TxPoolPerformanceModel
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!TxPoolPerformanceModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in TxPoolPerformanceModel is not found in the empty JSON string", TxPoolPerformanceModel.openapiRequiredFields.toString()));
        }
      }

      Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
      // check to see if the JSON string contains additional fields
      for (Map.Entry<String, JsonElement> entry : entries) {
        if (!TxPoolPerformanceModel.openapiFields.contains(entry.getKey())) {
          throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `TxPoolPerformanceModel` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
  }

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

       return (TypeAdapter<T>) new TypeAdapter<TxPoolPerformanceModel>() {
           @Override
           public void write(JsonWriter out, TxPoolPerformanceModel value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             elementAdapter.write(out, obj);
           }

           @Override
           public TxPoolPerformanceModel read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             validateJsonElement(jsonElement);
             return thisAdapter.fromJsonTree(jsonElement);
           }

       }.nullSafe();
    }
  }

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

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

