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

io.api.etherscan.model.UncleBlock Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package io.api.etherscan.model;

import io.api.etherscan.util.BasicUtils;

import java.util.List;

/**
 * ! NO DESCRIPTION !
 *
 * @author GoodforGod
 * @since 30.10.2018
 */
public class UncleBlock extends Block {

    private String blockMiner;
    private List uncles;
    private String uncleInclusionReward;

    //
    public boolean isEmpty() {
        return getBlockNumber() == 0 && getBlockReward() == null
                && getTimeStamp() == null
                && BasicUtils.isEmpty(blockMiner);
    }

    public String getBlockMiner() {
        return blockMiner;
    }

    public List getUncles() {
        return uncles;
    }

    public String getUncleInclusionReward() {
        return uncleInclusionReward;
    }
    //

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        UncleBlock that = (UncleBlock) o;

        return getBlockNumber() != 0 && getBlockNumber() == that.getBlockNumber();
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = (int) (31 * result + getBlockNumber());
        return result;
    }

    @Override
    public String toString() {
        return "UncleBlock{" +
                "blockMiner='" + blockMiner + '\'' +
                ", uncles=" + uncles +
                ", uncleInclusionReward='" + uncleInclusionReward + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy