public class LeadershipEvent<T> extends AbstractEvent<LeadershipEvent.Type,Leadership>
| Modifier and Type | Class and Description |
|---|---|
static class |
LeadershipEvent.Type
Type of leadership events.
|
| Constructor and Description |
|---|
LeadershipEvent(LeadershipEvent.Type type,
String topic,
Leadership<T> oldLeadership,
Leadership<T> newLeadership)
Creates an event of a given type and for the specified instance and the
current time.
|
LeadershipEvent(LeadershipEvent.Type type,
String topic,
Leadership<T> oldLeadership,
Leadership<T> newLeadership,
long time)
Creates an event of a given type and for the specified subject and time.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
Leadership<T> |
newLeadership()
Returns the new leadership for the topic.
|
Leadership<T> |
oldLeadership()
Returns the prior leadership for the topic.
|
String |
topic()
Returns the leader election topic.
|
String |
toString() |
subject, time, typepublic LeadershipEvent(LeadershipEvent.Type type, String topic, Leadership<T> oldLeadership, Leadership<T> newLeadership)
type - leadership event typeoldLeadership - previous leadershipnewLeadership - new leadershippublic LeadershipEvent(LeadershipEvent.Type type, String topic, Leadership<T> oldLeadership, Leadership<T> newLeadership, long time)
type - leadership event typeoldLeadership - previous leadershipnewLeadership - new leadershiptime - occurrence timepublic String topic()
public Leadership<T> oldLeadership()
public Leadership<T> newLeadership()
public String toString()
toString in class AbstractEvent<LeadershipEvent.Type,Leadership>Copyright © 2013–2018. All rights reserved.