Class TopicMessage

java.lang.Object
com.hedera.hashgraph.sdk.TopicMessage

public final class TopicMessage extends Object
Topic message records.
  • Field Details

    • consensusTimestamp

      public final Instant consensusTimestamp
      The consensus timestamp of the message in seconds.nanoseconds
    • contents

      public final byte[] contents
      The content of the message
    • runningHash

      public final byte[] runningHash
      The new running hash of the topic that received the message
    • sequenceNumber

      public final long sequenceNumber
      The sequence number of the message relative to all other messages for the same topic
    • chunks

      @Nullable public final TopicMessageChunk[] chunks
      Array of topic message chunks.
    • transactionId

      @Nullable public final TransactionId transactionId
      The transaction id
  • Constructor Details

    • TopicMessage

      TopicMessage(Instant lastConsensusTimestamp, byte[] message, byte[] lastRunningHash, long lastSequenceNumber, @Nullable TopicMessageChunk[] chunks, @Nullable TransactionId transactionId)
      Constructor.
      Parameters:
      lastConsensusTimestamp - the last consensus time
      message - the message
      lastRunningHash - the last running hash
      lastSequenceNumber - the last sequence number
      chunks - the array of chunks
      transactionId - the transaction id
  • Method Details

    • ofSingle

      static TopicMessage ofSingle(ConsensusTopicResponse response)
      Create a new topic message from a response protobuf.
      Parameters:
      response - the protobuf response
      Returns:
      the new topic message
    • ofMany

      static TopicMessage ofMany(List<ConsensusTopicResponse> responses)
      Create a new topic message from a list of response's protobuf.
      Parameters:
      responses - the protobuf response
      Returns:
      the new topic message
    • toString

      public String toString()
      Overrides:
      toString in class Object