io.nuls.contract.sdk.BlockHeader Maven / Gradle / Ivy
package io.nuls.contract.sdk;
public class BlockHeader {
private String hash;
private long time;
private long height;
private long txCount;
private Address packingAddress;
private String stateRoot;
public String getHash() {
return hash;
}
public long getTime() {
return time;
}
public long getHeight() {
return height;
}
public long getTxCount() {
return txCount;
}
public Address getPackingAddress() {
return packingAddress;
}
public String getStateRoot() {
return stateRoot;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BlockHeader that = (BlockHeader) o;
if (time != that.time) return false;
if (height != that.height) return false;
if (txCount != that.txCount) return false;
if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false;
if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null)
return false;
return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null;
}
@Override
public int hashCode() {
int result = hash != null ? hash.hashCode() : 0;
result = 31 * result + (int) (time ^ (time >>> 32));
result = 31 * result + (int) (height ^ (height >>> 32));
result = 31 * result + (int) (txCount ^ (txCount >>> 32));
result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0);
result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "BlockHeader{" +
"hash='" + hash + '\'' +
", time=" + time +
", height=" + height +
", txCount=" + txCount +
", packingAddress=" + packingAddress +
", stateRoot='" + stateRoot + '\'' +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy