com.netflix.curator.framework.recipes.leader
Class Participant
java.lang.Object
com.netflix.curator.framework.recipes.leader.Participant
public class Participant
- extends java.lang.Object
Describes a participant in a leadership selection
|
Constructor Summary |
Participant(java.lang.String id,
boolean leader)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Participant
public Participant(java.lang.String id,
boolean leader)
- Parameters:
id - the IDleader - true if the leader
getId
public java.lang.String getId()
- Returns the ID set via
LeaderSelector.setId(String)
- Returns:
- id
isLeader
public boolean isLeader()
- Returns true if this participant is the current leader
- Returns:
- true/false
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object