@ThreadSafe
public class ContractEntry
extends java.lang.Object
ContractEntry
will keep track of:
Modifier and Type | Class and Description |
---|---|
static class |
ContractEntry.Key
A
Key to associate a contract id with a ClientIdentityKey . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BINARY_NAME |
static java.lang.String |
BYTE_CODE |
static java.lang.String |
ENTITY_ID |
static java.lang.String |
ID |
static java.lang.String |
KEY_VERSION |
static java.lang.String |
PROPERTIES |
static java.lang.String |
REGISTERED_AT |
static java.lang.String |
SIGNATURE |
Constructor and Description |
---|
ContractEntry(java.lang.String id,
java.lang.String binaryName,
java.lang.String entityId,
int keyVersion,
byte[] byteCode,
java.lang.String properties,
long registeredAt,
byte[] signature)
Constructs a
ContractEntry with the specified contract id, contract binary name, entity
id, certificate version, bytecode of the contract, properties of the contract, the time the
contract was registered at, and the signature of the contract. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this object.
|
static ContractEntry |
from(ContractRegistrationRequest request)
Turns a
ContractRegistrationRequest into a ContractEntry by adding a registered
at time, and returns it. |
java.lang.String |
getBinaryName()
Returns the binary name of the
ContractEntry . |
byte[] |
getByteCode()
Returns the bytecode of the contract contained in the
ContractEntry . |
ClientIdentityKey |
getClientIdentityKey()
Returns the
ClientIdentityKey of the ContractEntry . |
java.lang.String |
getEntityId()
Returns the entity id that holds the certificate of the
ContractEntry . |
java.lang.String |
getId()
Returns the id of the
ContractEntry . |
ContractEntry.Key |
getKey()
Returns the
Key of the ContractEntry . |
int |
getKeyVersion()
Returns the version of the certificate or the HMAC secret key of the
ContractEntry . |
java.util.Optional<java.lang.String> |
getProperties()
Returns the properties of the
ContractEntry (may be empty). |
long |
getRegisteredAt()
Returns the registered at time of the
ContractEntry . |
byte[] |
getSignature()
Returns the properties of the
ContractEntry (may be empty). |
int |
hashCode()
Returns a hash code value for the object.
|
public static final java.lang.String ENTITY_ID
public static final java.lang.String KEY_VERSION
public static final java.lang.String ID
public static final java.lang.String BINARY_NAME
public static final java.lang.String BYTE_CODE
public static final java.lang.String PROPERTIES
public static final java.lang.String REGISTERED_AT
public static final java.lang.String SIGNATURE
public ContractEntry(java.lang.String id, java.lang.String binaryName, java.lang.String entityId, int keyVersion, byte[] byteCode, @Nullable java.lang.String properties, long registeredAt, byte[] signature)
ContractEntry
with the specified contract id, contract binary name, entity
id, certificate version, bytecode of the contract, properties of the contract, the time the
contract was registered at, and the signature of the contract.id
- a contract idbinaryName
- a binary name of the contractentityId
- an entity idkeyVersion
- a certificate versionbyteCode
- bytecode of the contractproperties
- properties of the contractregisteredAt
- the time the contract was registeredsignature
- the signature of the contractpublic ContractEntry.Key getKey()
Key
of the ContractEntry
. A Key is made up of the contract id and a
CertificateEntry.Key
.Key
of the ContractEntry
public ClientIdentityKey getClientIdentityKey()
ClientIdentityKey
of the ContractEntry
. The ClientIdentityKey
is made up of the entity id and version.ClientIdentityKey
of the ContractEntry
public java.lang.String getId()
ContractEntry
.ContractEntry
public java.lang.String getBinaryName()
ContractEntry
.ContractEntry
public java.lang.String getEntityId()
ContractEntry
.ContractEntry
public int getKeyVersion()
ContractEntry
.ContractEntry
public byte[] getByteCode()
ContractEntry
.ContractEntry
public java.util.Optional<java.lang.String> getProperties()
ContractEntry
(may be empty).ContractEntry
public long getRegisteredAt()
ContractEntry
.ContractEntry
public byte[] getSignature()
ContractEntry
(may be empty).ContractEntry
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
ContractEntry
and both instances have the same
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 static ContractEntry from(ContractRegistrationRequest request)
ContractRegistrationRequest
into a ContractEntry
by adding a registered
at time, and returns it.request
- a ContractRegistrationRequest
ContractEntry