Package io.vertx.kafka.client.common
Class Node
- java.lang.Object
-
- io.vertx.kafka.client.common.Node
-
public class Node extends Object
Information about a Kafka cluster node
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHost()
int
getId()
String
getIdString()
int
getPort()
boolean
hasRack()
boolean
isEmpty()
String
rack()
Node
setHasRack(boolean hasRack)
Set if this node has a defined rackNode
setHost(String host)
Set the host name for this nodeNode
setId(int id)
Set the node id of this nodeNode
setIdString(String idString)
Set the string representation of the node idNode
setIsEmpty(boolean isEmpty)
Set if this node is emptyNode
setPort(int port)
Set the port for this nodeNode
setRack(String rack)
Set the rack for this nodeJsonObject
toJson()
Convert object to JSON representationString
toString()
-
-
-
Constructor Detail
-
Node
public Node()
Constructor
-
Node
public Node(boolean hasRack, String host, int id, String idString, boolean isEmpty, int port, String rack)
Constructor- Parameters:
hasRack
- true if this node has a defined rackhost
- the host name for this nodeid
- the node id of this nodeidString
- String representation of the node idisEmpty
- if this node is empty, which may be the case if noNode() is used as a placeholder in a response payload with an errorport
- the port for this noderack
- the rack for this node
-
Node
public Node(JsonObject json)
Constructor (from JSON representation)- Parameters:
json
- JSON representation
-
-
Method Detail
-
hasRack
public boolean hasRack()
- Returns:
- true if this node has a defined rack
-
setHasRack
public Node setHasRack(boolean hasRack)
Set if this node has a defined rack- Parameters:
hasRack
- if this node has a defined rack- Returns:
- current instance of the class to be fluent
-
getHost
public String getHost()
- Returns:
- the host name for this node
-
setHost
public Node setHost(String host)
Set the host name for this node- Parameters:
host
- the host name for this node- Returns:
- current instance of the class to be fluent
-
getId
public int getId()
- Returns:
- the node id of this node
-
setId
public Node setId(int id)
Set the node id of this node- Parameters:
id
- the node id of this node- Returns:
- current instance of the class to be fluent
-
getIdString
public String getIdString()
- Returns:
- String representation of the node id
-
setIdString
public Node setIdString(String idString)
Set the string representation of the node id- Parameters:
idString
- String representation of the node id- Returns:
- current instance of the class to be fluent
-
isEmpty
public boolean isEmpty()
- Returns:
- if this node is empty, which may be the case if noNode() is used as a placeholder in a response payload with an error
-
setIsEmpty
public Node setIsEmpty(boolean isEmpty)
Set if this node is empty- Parameters:
isEmpty
- if this node is empty- Returns:
- current instance of the class to be fluent
-
getPort
public int getPort()
- Returns:
- the port for this node
-
setPort
public Node setPort(int port)
Set the port for this node- Parameters:
port
- the port for this node- Returns:
- current instance of the class to be fluent
-
rack
public String rack()
- Returns:
- the rack for this node
-
setRack
public Node setRack(String rack)
Set the rack for this node- Parameters:
rack
- the rack for this node- Returns:
- current instance of the class to be fluent
-
toJson
public JsonObject toJson()
Convert object to JSON representation- Returns:
- JSON representation
-
-