forked from GoodforGod/java-etherscan-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTx.java
104 lines (87 loc) · 3.28 KB
/
Tx.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package io.api.etherscan.model;
import io.api.etherscan.util.BasicUtils;
import java.math.BigInteger;
/**
* ! NO DESCRIPTION !
*
* @author GoodforGod
* @since 28.10.2018
*/
public class Tx extends BaseTx {
private long nonce;
private String blockHash;
private int transactionIndex;
private BigInteger gasPrice;
private BigInteger cumulativeGasUsed;
private long confirmations;
private String isError;
private String txreceipt_status;
//<editor-fold desc="Getters">
public long getNonce() {
return nonce;
}
public String getBlockHash() {
return blockHash;
}
public int getTransactionIndex() {
return transactionIndex;
}
public BigInteger getGasPrice() {
return gasPrice;
}
public boolean haveError() {
return !BasicUtils.isEmpty(isError) && !isError.equals("0");
}
public String getTxreceipt_status() {
return txreceipt_status;
}
public BigInteger getCumulativeGasUsed() {
return cumulativeGasUsed;
}
public long getConfirmations() {
return confirmations;
}
//</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;
Tx tx = (Tx) o;
if (nonce != tx.nonce) return false;
if (transactionIndex != tx.transactionIndex) return false;
if (confirmations != tx.confirmations) return false;
if (blockHash != null ? !blockHash.equals(tx.blockHash) : tx.blockHash != null) return false;
if (gasPrice != null ? !gasPrice.equals(tx.gasPrice) : tx.gasPrice != null) return false;
if (cumulativeGasUsed != null ? !cumulativeGasUsed.equals(tx.cumulativeGasUsed) : tx.cumulativeGasUsed != null)
return false;
if (isError != null ? !isError.equals(tx.isError) : tx.isError != null) return false;
return txreceipt_status != null ? txreceipt_status.equals(tx.txreceipt_status) : tx.txreceipt_status == null;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (int) (nonce ^ (nonce >>> 32));
result = 31 * result + (blockHash != null ? blockHash.hashCode() : 0);
result = 31 * result + transactionIndex;
result = 31 * result + (gasPrice != null ? gasPrice.hashCode() : 0);
result = 31 * result + (cumulativeGasUsed != null ? cumulativeGasUsed.hashCode() : 0);
result = 31 * result + (int) (confirmations ^ (confirmations >>> 32));
result = 31 * result + (isError != null ? isError.hashCode() : 0);
result = 31 * result + (txreceipt_status != null ? txreceipt_status.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Tx{" +
"nonce=" + nonce +
", blockHash='" + blockHash + '\'' +
", transactionIndex=" + transactionIndex +
", gasPrice=" + gasPrice +
", cumulativeGasUsed=" + cumulativeGasUsed +
", confirmations=" + confirmations +
", isError='" + isError + '\'' +
", txreceipt_status='" + txreceipt_status + '\'' +
'}';
}
}