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

software.crldev.elrondspringbootstarterreactive.api.model.ESDTToken Maven / Gradle / Ivy

Go to download

A SpringBoot Starter solution designed to ensure easy and efficient integration with the Elrond Network using a Reactive API layer.

The newest version!
package software.crldev.elrondspringbootstarterreactive.api.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * part of API response used in ESDT queries
 *
 * @author carlo_stanciu
 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = ESDTToken.ESDTTokenBuilder.class)
public final class ESDTToken {
    @JsonProperty("tokenIdentifier")
    private final String identifier;
    @JsonProperty("balance")
    private final String balance;

    ESDTToken(final String identifier, final String balance) {
        this.identifier = identifier;
        this.balance = balance;
    }


    @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "", buildMethodName = "build")
    public static class ESDTTokenBuilder {
        private String identifier;
        private String balance;

        ESDTTokenBuilder() {
        }

        /**
         * @return {@code this}.
         */
        @JsonProperty("tokenIdentifier")
        public ESDTToken.ESDTTokenBuilder identifier(final String identifier) {
            this.identifier = identifier;
            return this;
        }

        /**
         * @return {@code this}.
         */
        @JsonProperty("balance")
        public ESDTToken.ESDTTokenBuilder balance(final String balance) {
            this.balance = balance;
            return this;
        }

        public ESDTToken build() {
            return new ESDTToken(this.identifier, this.balance);
        }

        @Override
        public String toString() {
            return "ESDTToken.ESDTTokenBuilder(identifier=" + this.identifier + ", balance=" + this.balance + ")";
        }
    }

    public static ESDTToken.ESDTTokenBuilder builder() {
        return new ESDTToken.ESDTTokenBuilder();
    }

    public String getIdentifier() {
        return this.identifier;
    }

    public String getBalance() {
        return this.balance;
    }

    @Override
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof ESDTToken)) return false;
        final ESDTToken other = (ESDTToken) o;
        final Object this$identifier = this.getIdentifier();
        final Object other$identifier = other.getIdentifier();
        if (this$identifier == null ? other$identifier != null : !this$identifier.equals(other$identifier)) return false;
        final Object this$balance = this.getBalance();
        final Object other$balance = other.getBalance();
        if (this$balance == null ? other$balance != null : !this$balance.equals(other$balance)) return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $identifier = this.getIdentifier();
        result = result * PRIME + ($identifier == null ? 43 : $identifier.hashCode());
        final Object $balance = this.getBalance();
        result = result * PRIME + ($balance == null ? 43 : $balance.hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "ESDTToken(identifier=" + this.getIdentifier() + ", balance=" + this.getBalance() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy