Class TransactionMessage.Builder
java.lang.Object
com.exonum.binding.common.message.TransactionMessage.Builder
- Enclosing interface:
- TransactionMessage
public static class TransactionMessage.Builder extends Object
Builder for the binary transaction message.
-
Method Summary
Modifier and Type Method Description TransactionMessagebuild()Signs the message, creating a new signed binary transaction message.TransactionMessage.Builderpayload(byte[] payload)Sets a payload of the transaction message.TransactionMessage.Builderpayload(com.google.protobuf.ByteString payload)Sets a payload of the transaction message.TransactionMessage.Builderpayload(com.google.protobuf.MessageLite payload)Sets a payload of the transaction message.TransactionMessage.Builderpayload(ByteBuffer payload)Sets a payload of the transaction message.TransactionMessage.BuilderserviceId(int serviceId)Sets service identifier to the transaction message.TransactionMessagesign(KeyPair keys)Signs the message with the given Ed25519 keys, creating a new signed binary transaction message.TransactionMessage.BuildersignedWith(KeyPair keys)Sets the Ed25519 key pair to use to sign the message.TransactionMessage.BuildersignedWith(KeyPair keys, CryptoFunction crypto)Sets the key pair and the crypto function to use to sign the message.TransactionMessage.BuildertransactionId(int transactionId)Sets transaction identifier to the transaction message.
-
Method Details
-
serviceId
Sets service identifier to the transaction message. -
transactionId
Sets transaction identifier to the transaction message. -
payload
Sets a payload of the transaction message. -
payload
Sets a payload of the transaction message. -
payload
Sets a payload of the transaction message. -
payload
Sets a payload of the transaction message. -
signedWith
Sets the Ed25519 key pair to use to sign the message.- Parameters:
keys- a key pair with a private and public keys. The public key is included in the message as an author key of the message. The private key is used for signing the message, but not included in it
-
signedWith
Sets the key pair and the crypto function to use to sign the message.- Parameters:
keys- a key pair with a private and public keys. The public key is included in the message as an author key of the message. The private key is used for signing the message, but not included in itcrypto- a cryptographic function to use
-
sign
Signs the message with the given Ed25519 keys, creating a new signed binary transaction message. A shorthand forsignedWith(keys).build().- Parameters:
keys- a key pair to sign the message- Returns:
- a new signed binary transaction message
- Throws:
IllegalStateException- if any field weren't setIllegalArgumentException- if the public key has wrong size
-
build
Signs the message, creating a new signed binary transaction message.- Returns:
- a new signed binary transaction message
- Throws:
IllegalStateException- if any field weren't setIllegalArgumentException- if the public key has wrong size
-