2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.raft;
11 * Stores information about a raft peer.
13 * @author Thomas Pantelis
15 public class PeerInfo {
16 private final String id;
17 private String address;
18 private VotingState votingState;
20 public PeerInfo(String id, String address, VotingState votingState) {
22 this.address = address;
23 this.votingState = votingState;
26 public String getId() {
30 public String getAddress() {
34 public VotingState getVotingState() {
38 public boolean isVoting() {
39 return votingState == VotingState.VOTING;
42 public void setAddress(String address) {
43 this.address = address;
46 public void setVotingState(VotingState votingState) {
47 this.votingState = votingState;
51 public String toString() {
52 return "PeerInfo [id=" + id + ", address=" + address + ", votingState=" + votingState + "]";