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

software.crldev.elrondspringbootstarterreactive.api.model.AccountBalance 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;
import java.math.BigInteger;

/**
 * API response when querying for address balance
 *
 * @author carlo_stanciu
 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = AccountBalance.AccountBalanceBuilder.class)
public final class AccountBalance {
    @JsonProperty("balance")
    private final BigInteger balance;

    AccountBalance(final BigInteger balance) {
        this.balance = balance;
    }


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

        AccountBalanceBuilder() {
        }

        /**
         * @return {@code this}.
         */
        @JsonProperty("balance")
        public AccountBalance.AccountBalanceBuilder balance(final BigInteger balance) {
            this.balance = balance;
            return this;
        }

        public AccountBalance build() {
            return new AccountBalance(this.balance);
        }

        @Override
        public String toString() {
            return "AccountBalance.AccountBalanceBuilder(balance=" + this.balance + ")";
        }
    }

    public static AccountBalance.AccountBalanceBuilder builder() {
        return new AccountBalance.AccountBalanceBuilder();
    }

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

    @Override
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof AccountBalance)) return false;
        final AccountBalance other = (AccountBalance) o;
        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 $balance = this.getBalance();
        result = result * PRIME + ($balance == null ? 43 : $balance.hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "AccountBalance(balance=" + this.getBalance() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy