com.netflix.curator.framework.recipes.leader
Class Participant

java.lang.Object
  extended by com.netflix.curator.framework.recipes.leader.Participant

public class Participant
extends Object

Describes a participant in a leadership selection


Constructor Summary
Participant(String id, boolean leader)
           
 
Method Summary
 boolean equals(Object o)
           
 String getId()
          Returns the ID set via LeaderSelector.setId(String)
 int hashCode()
           
 boolean isLeader()
          Returns true if this participant is the current leader
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Participant

public Participant(String id,
                   boolean leader)
Parameters:
id - the ID
leader - true if the leader
Method Detail

getId

public 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 String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.