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

software.crldev.elrondspringbootstarterreactive.domain.esdt.common.TokenProperty 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.domain.esdt.common;

import org.bouncycastle.util.encoders.Hex;

/**
 * Value object for ESDT token property name
 *
 * @author carlo_stanciu
 */
public final class TokenProperty {
    private final TokenPropertyName name;
    private final Boolean value;

    /**
     * Getter
     *
     * @return - hex value of the property name
     */
    public String getNameHex() {
        return name.getHex();
    }

    /**
     * Getter
     *
     * @return - hex value of the property name
     */
    public String getValueHex() {
        return Hex.toHexString(value.toString().getBytes());
    }

    public TokenPropertyName getName() {
        return this.name;
    }

    public Boolean getValue() {
        return this.value;
    }

    @Override
    public String toString() {
        return "TokenProperty(name=" + this.getName() + ", value=" + this.getValue() + ")";
    }

    public TokenProperty(final TokenPropertyName name, final Boolean value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof TokenProperty)) return false;
        final TokenProperty other = (TokenProperty) o;
        final Object this$name = this.name;
        final Object other$name = other.name;
        if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
        return true;
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy