Class MessageIdImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<org.apache.pulsar.client.api.MessageId>, org.apache.pulsar.client.api.MessageId
    Direct Known Subclasses:
    BatchMessageIdImpl

    public class MessageIdImpl
    extends java.lang.Object
    implements org.apache.pulsar.client.api.MessageId
    See Also:
    Serialized Form
    • Field Detail

      • ledgerId

        protected final long ledgerId
      • entryId

        protected final long entryId
      • partitionIndex

        protected final int partitionIndex
    • Constructor Detail

      • MessageIdImpl

        public MessageIdImpl​(long ledgerId,
                             long entryId,
                             int partitionIndex)
    • Method Detail

      • getLedgerId

        public long getLedgerId()
      • getEntryId

        public long getEntryId()
      • getPartitionIndex

        public int getPartitionIndex()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • fromByteArray

        public static org.apache.pulsar.client.api.MessageId fromByteArray​(byte[] data)
                                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • convertToMessageIdImpl

        public static MessageIdImpl convertToMessageIdImpl​(org.apache.pulsar.client.api.MessageId messageId)
      • fromByteArrayWithTopic

        public static org.apache.pulsar.client.api.MessageId fromByteArrayWithTopic​(byte[] data,
                                                                                    java.lang.String topicName)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • fromByteArrayWithTopic

        public static org.apache.pulsar.client.api.MessageId fromByteArrayWithTopic​(byte[] data,
                                                                                    org.apache.pulsar.common.naming.TopicName topicName)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • toByteArray

        protected byte[] toByteArray​(int batchIndex,
                                     int batchSize)
      • toByteArray

        public byte[] toByteArray()
        Specified by:
        toByteArray in interface org.apache.pulsar.client.api.MessageId
      • compareTo

        public int compareTo​(org.apache.pulsar.client.api.MessageId o)
        Specified by:
        compareTo in interface java.lang.Comparable<org.apache.pulsar.client.api.MessageId>