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 boolean
equals(Object o)
int
getPartition()
String
getTopic()
int
hashCode()
TopicPartition
setPartition(int partition)
Set the partition numberTopicPartition
setTopic(String topic)
Set the topic nameJsonObject
toJson()
Convert object to JSON representationString
toString()
-
-
-
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
-
-