|
| 1 | +package io.goodforgod.api.etherscan.model; |
| 2 | + |
| 3 | +import java.util.Objects; |
| 4 | + |
| 5 | +public class ContractCreation { |
| 6 | + |
| 7 | + private final String contractAddress; |
| 8 | + private final String contractCreator; |
| 9 | + private final String txHash; |
| 10 | + |
| 11 | + private ContractCreation(String contractAddress, String contractCreator, String txHash) { |
| 12 | + this.contractAddress = contractAddress; |
| 13 | + this.contractCreator = contractCreator; |
| 14 | + this.txHash = txHash; |
| 15 | + } |
| 16 | + |
| 17 | + public String getContractAddress() { |
| 18 | + return contractAddress; |
| 19 | + } |
| 20 | + |
| 21 | + public String getContractCreator() { |
| 22 | + return contractCreator; |
| 23 | + } |
| 24 | + |
| 25 | + public String getTxHash() { |
| 26 | + return txHash; |
| 27 | + } |
| 28 | + |
| 29 | + @Override |
| 30 | + public boolean equals(Object o) { |
| 31 | + if (this == o) |
| 32 | + return true; |
| 33 | + if (o == null || getClass() != o.getClass()) |
| 34 | + return false; |
| 35 | + ContractCreation that = (ContractCreation) o; |
| 36 | + return Objects.equals(contractAddress, that.contractAddress) && Objects.equals(contractCreator, that.contractCreator) |
| 37 | + && Objects.equals(txHash, that.txHash); |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + public int hashCode() { |
| 42 | + return Objects.hash(contractAddress, contractCreator, txHash); |
| 43 | + } |
| 44 | + |
| 45 | + @Override |
| 46 | + public String toString() { |
| 47 | + return "ContractCreation{" + |
| 48 | + "contractAddress='" + contractAddress + '\'' + |
| 49 | + ", contractCreator='" + contractCreator + '\'' + |
| 50 | + ", txHash='" + txHash + '\'' + |
| 51 | + '}'; |
| 52 | + } |
| 53 | + |
| 54 | + public static ContractCreationBuilder builder() { |
| 55 | + return new ContractCreationBuilder(); |
| 56 | + } |
| 57 | + |
| 58 | + public static final class ContractCreationBuilder { |
| 59 | + |
| 60 | + private String contractAddress; |
| 61 | + private String contractCreator; |
| 62 | + private String txHash; |
| 63 | + |
| 64 | + private ContractCreationBuilder() {} |
| 65 | + |
| 66 | + public ContractCreationBuilder withContractAddress(String contractAddress) { |
| 67 | + this.contractAddress = contractAddress; |
| 68 | + return this; |
| 69 | + } |
| 70 | + |
| 71 | + public ContractCreationBuilder withContractCreator(String contractCreator) { |
| 72 | + this.contractCreator = contractCreator; |
| 73 | + return this; |
| 74 | + } |
| 75 | + |
| 76 | + public ContractCreationBuilder withTxHash(String txHash) { |
| 77 | + this.txHash = txHash; |
| 78 | + return this; |
| 79 | + } |
| 80 | + |
| 81 | + public ContractCreation build() { |
| 82 | + return new ContractCreation(contractAddress, contractCreator, txHash); |
| 83 | + } |
| 84 | + } |
| 85 | +} |
0 commit comments