content: /*
   * Adyen Recurring API
   *
   * The version of the OpenAPI document: 68
   *
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  package com.adyen.model.recurring;
  
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.util.*;
  import java.util.HashMap;
  import java.util.Map;
  
  /** TokenDetails */
  @JsonPropertyOrder({
    TokenDetails.JSON_PROPERTY_TOKEN_DATA,
    TokenDetails.JSON_PROPERTY_TOKEN_DATA_TYPE
  })
  public class TokenDetails {
    public static final String JSON_PROPERTY_TOKEN_DATA = "tokenData";
    private Map<String, String> tokenData;
  
    public static final String JSON_PROPERTY_TOKEN_DATA_TYPE = "tokenDataType";
    private String tokenDataType;
  
    public TokenDetails() {}
  
    /**
     * tokenData
     *
     * @param tokenData
     * @return the current {@code TokenDetails} instance, allowing for method chaining
     */
    public TokenDetails tokenData(Map<String, String> tokenData) {
      this.tokenData = tokenData;
      return this;
    }
  
    public TokenDetails putTokenDataItem(String key, String tokenDataItem) {
      if (this.tokenData == null) {
        this.tokenData = new HashMap<>();
      }
      this.tokenData.put(key, tokenDataItem);
      return this;
    }
  
    /**
     * Get tokenData
     *
     * @return tokenData
     */
    @JsonProperty(JSON_PROPERTY_TOKEN_DATA)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Map<String, String> getTokenData() {
      return tokenData;
    }
  
    /**
     * tokenData
     *
     * @param tokenData
     */
    @JsonProperty(JSON_PROPERTY_TOKEN_DATA)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTokenData(Map<String, String> tokenData) {
      this.tokenData = tokenData;
    }
  
    /**
     * tokenDataType
     *
     * @param tokenDataType
     * @return the current {@code TokenDetails} instance, allowing for method chaining
     */
    public TokenDetails tokenDataType(String tokenDataType) {
      this.tokenDataType = tokenDataType;
      return this;
    }
  
    /**
     * Get tokenDataType
     *
     * @return tokenDataType
     */
    @JsonProperty(JSON_PROPERTY_TOKEN_DATA_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getTokenDataType() {
      return tokenDataType;
    }
  
    /**
     * tokenDataType
     *
     * @param tokenDataType
     */
    @JsonProperty(JSON_PROPERTY_TOKEN_DATA_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTokenDataType(String tokenDataType) {
      this.tokenDataType = tokenDataType;
    }
  
    /** Return true if this TokenDetails object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      TokenDetails tokenDetails = (TokenDetails) o;
      return Objects.equals(this.tokenData, tokenDetails.tokenData)
          && Objects.equals(this.tokenDataType, tokenDetails.tokenDataType);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(tokenData, tokenDataType);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class TokenDetails {\n");
      sb.append("    tokenData: ").append(toIndentedString(tokenData)).append("\n");
      sb.append("    tokenDataType: ").append(toIndentedString(tokenDataType)).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    ");
    }
  
    /**
     * Create an instance of TokenDetails given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of TokenDetails
     * @throws JsonProcessingException if the JSON string is invalid with respect to TokenDetails
     */
    public static TokenDetails fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, TokenDetails.class);
    }
  
    /**
     * Convert an instance of TokenDetails to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  