All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fireblocks.sdk.model.AssetResponseOnchain Maven / Gradle / Ivy

/*
 * Fireblocks API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.6.2
 * Contact: [email protected]
 *
 * 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.fireblocks.sdk.model;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.StringJoiner;

/** AssetResponseOnchain */
@JsonPropertyOrder({
    AssetResponseOnchain.JSON_PROPERTY_SYMBOL,
    AssetResponseOnchain.JSON_PROPERTY_NAME,
    AssetResponseOnchain.JSON_PROPERTY_ADDRESS,
    AssetResponseOnchain.JSON_PROPERTY_DECIMALS,
    AssetResponseOnchain.JSON_PROPERTY_STANDARD
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AssetResponseOnchain {
    public static final String JSON_PROPERTY_SYMBOL = "symbol";
    private String symbol;

    public static final String JSON_PROPERTY_NAME = "name";
    private String name;

    public static final String JSON_PROPERTY_ADDRESS = "address";
    private String address;

    public static final String JSON_PROPERTY_DECIMALS = "decimals";
    private BigDecimal decimals;

    public static final String JSON_PROPERTY_STANDARD = "standard";
    private String standard;

    public AssetResponseOnchain() {}

    public AssetResponseOnchain symbol(String symbol) {
        this.symbol = symbol;
        return this;
    }

    /**
     * The asset symbol
     *
     * @return symbol
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_SYMBOL)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getSymbol() {
        return symbol;
    }

    @JsonProperty(JSON_PROPERTY_SYMBOL)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    public AssetResponseOnchain name(String name) {
        this.name = name;
        return this;
    }

    /**
     * The asset name
     *
     * @return name
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getName() {
        return name;
    }

    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setName(String name) {
        this.name = name;
    }

    public AssetResponseOnchain address(String address) {
        this.address = address;
        return this;
    }

    /**
     * The asset address
     *
     * @return address
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getAddress() {
        return address;
    }

    @JsonProperty(JSON_PROPERTY_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAddress(String address) {
        this.address = address;
    }

    public AssetResponseOnchain decimals(BigDecimal decimals) {
        this.decimals = decimals;
        return this;
    }

    /**
     * Number of decimals
     *
     * @return decimals
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_DECIMALS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public BigDecimal getDecimals() {
        return decimals;
    }

    @JsonProperty(JSON_PROPERTY_DECIMALS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setDecimals(BigDecimal decimals) {
        this.decimals = decimals;
    }

    public AssetResponseOnchain standard(String standard) {
        this.standard = standard;
        return this;
    }

    /**
     * The asset standard
     *
     * @return standard
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_STANDARD)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getStandard() {
        return standard;
    }

    @JsonProperty(JSON_PROPERTY_STANDARD)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setStandard(String standard) {
        this.standard = standard;
    }

    /** Return true if this AssetResponse_onchain object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AssetResponseOnchain assetResponseOnchain = (AssetResponseOnchain) o;
        return Objects.equals(this.symbol, assetResponseOnchain.symbol)
                && Objects.equals(this.name, assetResponseOnchain.name)
                && Objects.equals(this.address, assetResponseOnchain.address)
                && Objects.equals(this.decimals, assetResponseOnchain.decimals)
                && Objects.equals(this.standard, assetResponseOnchain.standard);
    }

    @Override
    public int hashCode() {
        return Objects.hash(symbol, name, address, decimals, standard);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class AssetResponseOnchain {\n");
        sb.append("    symbol: ").append(toIndentedString(symbol)).append("\n");
        sb.append("    name: ").append(toIndentedString(name)).append("\n");
        sb.append("    address: ").append(toIndentedString(address)).append("\n");
        sb.append("    decimals: ").append(toIndentedString(decimals)).append("\n");
        sb.append("    standard: ").append(toIndentedString(standard)).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    ");
    }

    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
        return toUrlQueryString(null);
    }

    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
        String suffix = "";
        String containerSuffix = "";
        String containerPrefix = "";
        if (prefix == null) {
            // style=form, explode=true, e.g. /pet?name=cat&type=manx
            prefix = "";
        } else {
            // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
            prefix = prefix + "[";
            suffix = "]";
            containerSuffix = "]";
            containerPrefix = "[";
        }

        StringJoiner joiner = new StringJoiner("&");

        // add `symbol` to the URL query string
        if (getSymbol() != null) {
            joiner.add(
                    String.format(
                            "%ssymbol%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getSymbol()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `name` to the URL query string
        if (getName() != null) {
            joiner.add(
                    String.format(
                            "%sname%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `address` to the URL query string
        if (getAddress() != null) {
            joiner.add(
                    String.format(
                            "%saddress%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getAddress()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `decimals` to the URL query string
        if (getDecimals() != null) {
            joiner.add(
                    String.format(
                            "%sdecimals%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getDecimals()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `standard` to the URL query string
        if (getStandard() != null) {
            joiner.add(
                    String.format(
                            "%sstandard%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getStandard()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy