Class TransactionMessage.Builder
java.lang.Object
com.exonum.binding.common.message.TransactionMessage.Builder
- Enclosing interface:
- TransactionMessage
public static class TransactionMessage.Builder
extends java.lang.Object
Builder for the binary transaction message.
-
Method Summary
Modifier and Type Method Description TransactionMessage
build()
Signs the message, creating a new signed binary transaction message.TransactionMessage.Builder
payload(byte[] payload)
Sets a payload of the transaction message.TransactionMessage.Builder
payload(com.google.protobuf.ByteString payload)
Sets a payload of the transaction message.TransactionMessage.Builder
payload(com.google.protobuf.MessageLite payload)
Sets a payload of the transaction message.TransactionMessage.Builder
payload(java.nio.ByteBuffer payload)
Sets a payload of the transaction message.TransactionMessage.Builder
serviceId(int serviceId)
Sets service identifier to the transaction message.TransactionMessage
sign(KeyPair keys)
Signs the message with the given Ed25519 keys, creating a new signed binary transaction message.TransactionMessage.Builder
signedWith(KeyPair keys)
Sets the Ed25519 key pair to use to sign the message.TransactionMessage.Builder
signedWith(KeyPair keys, CryptoFunction crypto)
Sets the key pair and the crypto function to use to sign the message.TransactionMessage.Builder
transactionId(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:
java.lang.IllegalStateException
- if any field weren't setjava.lang.IllegalArgumentException
- 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:
java.lang.IllegalStateException
- if any field weren't setjava.lang.IllegalArgumentException
- if the public key has wrong size
-