java.lang.Object
com.hedera.hashgraph.sdk.HookEntityId
The ID of an entity using a hook.
This class represents the HookEntityId protobuf message, which can be either an account ID or a contract ID.
-
Constructor Summary
ConstructorsConstructorDescriptionHookEntityId(AccountId accountId) Create a HookEntityId with an account ID.HookEntityId(ContractId contractId) Create a HookEntityId with a contract ID. -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) static HookEntityIdfromProtobuf(HookEntityId proto) Create a HookEntityId from a protobuf message.Get the account ID.Get the contract ID.inthashCode()booleanCheck if this entity is an account.booleanCheck if this entity is a contract.(package private) HookEntityIdConvert this HookEntityId to a protobuf message.toString()
-
Constructor Details
-
HookEntityId
Create a HookEntityId with an account ID.- Parameters:
accountId- the account ID
-
HookEntityId
Create a HookEntityId with a contract ID.- Parameters:
contractId- the contract ID
-
-
Method Details
-
getAccountId
Get the account ID.- Returns:
- the account ID, or null if this entity is a contract
-
getContractId
Get the contract ID.- Returns:
- the contract ID, or null if this entity is an account
-
isAccount
public boolean isAccount()Check if this entity is an account.- Returns:
- true if this entity is an account, false if it's a contract
-
isContract
public boolean isContract()Check if this entity is a contract.- Returns:
- true if this entity is a contract, false if it's an account
-
toProtobuf
HookEntityId toProtobuf()Convert this HookEntityId to a protobuf message.- Returns:
- the protobuf HookEntityId
-
fromProtobuf
Create a HookEntityId from a protobuf message.- Parameters:
proto- the protobuf HookEntityId- Returns:
- a new HookEntityId instance
-
equals
-
hashCode
public int hashCode() -
toString
-