Class TopicPartition


  • public class TopicPartition
    extends Object
    Represent information related to a partition for a topic
    • Constructor Detail

      • TopicPartition

        public TopicPartition()
        Constructor
      • TopicPartition

        public TopicPartition​(String topic,
                              int partition)
        Constructor
        Parameters:
        topic - the topic name
        partition - the partition number
      • TopicPartition

        public TopicPartition​(JsonObject json)
        Constructor (from JSON representation)
        Parameters:
        json - JSON representation
      • TopicPartition

        public TopicPartition​(TopicPartition that)
        Constructor (copy)
        Parameters:
        that - object to copy
    • Method Detail

      • getTopic

        public String getTopic()
        Returns:
        the topic name
      • setTopic

        public TopicPartition setTopic​(String topic)
        Set the topic name
        Parameters:
        topic - the topic name
        Returns:
        current instance of the class to be fluent
      • getPartition

        public int getPartition()
        Returns:
        the partition number
      • setPartition

        public TopicPartition setPartition​(int partition)
        Set the partition number
        Parameters:
        partition - the partition number
        Returns:
        current instance of the class to be fluent
      • toJson

        public JsonObject toJson()
        Convert object to JSON representation
        Returns:
        JSON representation
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object