@Immutable
public class AssetProof
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AssetProof.Builder |
static class |
AssetProof.Key |
static class |
AssetProof.Range |
Constructor and Description |
---|
AssetProof(com.scalar.dl.rpc.AssetProof proof)
Constructs an
AssetProof with the specified AssetProof |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this object.
|
int |
getAge()
Returns the asset entry's age assigned by the server.
|
byte[] |
getHash()
Returns the hash of the asset entry.
|
java.lang.String |
getId()
Returns the asset's id.
|
java.lang.String |
getInput() |
AssetProof.Key |
getKey()
Returns the
Key of the AssetProof . |
java.lang.String |
getNonce()
Returns the nonce of the asset entry.
|
byte[] |
getPrevHash()
Returns the prev_hash of the asset entry.
|
byte[] |
getSignature()
Returns the signature of the proof entry.
|
int |
hashCode()
Returns a hash code value for the object.
|
static AssetProof.Builder |
newBuilder() |
static byte[] |
serialize(java.lang.String id,
int age,
java.lang.String nonce,
java.lang.String input,
byte[] hash,
byte[] prevHash) |
java.lang.String |
toString() |
void |
validateWith(SignatureValidator validator)
Validates if the proof is not tampered.
|
boolean |
valueEquals(java.lang.Object o)
Indicates whether some other object is "equal to" this object except for signature.
|
public AssetProof(com.scalar.dl.rpc.AssetProof proof)
AssetProof
with the specified AssetProof
proof
- a com.scalar.rpc.AssetProof
objectpublic AssetProof.Key getKey()
Key
of the AssetProof
.Key
of the AssetProof
public java.lang.String getId()
public int getAge()
public java.lang.String getNonce()
public java.lang.String getInput()
public byte[] getHash()
@Nullable public byte[] getPrevHash()
public byte[] getSignature()
public void validateWith(SignatureValidator validator)
validator
- a SignatureValidator
SignatureException
- if the proof is invalid.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
AssetProof
, and
equals
in class java.lang.Object
o
- an object to be tested for equalitytrue
if the other object is "equal to" this object otherwise false
public boolean valueEquals(java.lang.Object o)
AssetProof
, and
o
- an object to be tested for equalitytrue
if the other object is "equal to" this object otherwise false
public java.lang.String toString()
toString
in class java.lang.Object
public static AssetProof.Builder newBuilder()
public static byte[] serialize(java.lang.String id, int age, java.lang.String nonce, java.lang.String input, byte[] hash, byte[] prevHash)