Package io.vertx.kafka.client.common
Class TopicPartition
- java.lang.Object
-
- io.vertx.kafka.client.common.TopicPartition
-
public class TopicPartition extends Object
Represent information related to a partition for a topic
-
-
Constructor Summary
Constructors Constructor Description TopicPartition()ConstructorTopicPartition(JsonObject json)Constructor (from JSON representation)TopicPartition(TopicPartition that)Constructor (copy)TopicPartition(String topic, int partition)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetPartition()StringgetTopic()inthashCode()TopicPartitionsetPartition(int partition)Set the partition numberTopicPartitionsetTopic(String topic)Set the topic nameJsonObjecttoJson()Convert object to JSON representationStringtoString()
-
-
-
Constructor Detail
-
TopicPartition
public TopicPartition()
Constructor
-
TopicPartition
public TopicPartition(String topic, int partition)
Constructor- Parameters:
topic- the topic namepartition- 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
-
-