forked from GoodforGod/java-etherscan-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUncleBlock.java
65 lines (52 loc) · 1.54 KB
/
UncleBlock.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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<Uncle> uncles;
private String uncleInclusionReward;
//<editor-fold desc="Getters">
public boolean isEmpty() {
return getBlockNumber() == 0 && getBlockReward() == null
&& getTimeStamp() == null
&& BasicUtils.isEmpty(blockMiner);
}
public String getBlockMiner() {
return blockMiner;
}
public List<Uncle> getUncles() {
return uncles;
}
public String getUncleInclusionReward() {
return uncleInclusionReward;
}
//</editor-fold>
@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 + '\'' +
'}';
}
}