2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
3 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.raft.base.messages;
11 import java.io.Serializable;
14 * Message class to persist election term information.
16 public class UpdateElectionTerm implements Serializable {
17 private static final long serialVersionUID = 1L;
19 private final long currentTerm;
20 private final String votedFor;
22 public UpdateElectionTerm(long currentTerm, String votedFor) {
23 this.currentTerm = currentTerm;
24 this.votedFor = votedFor;
27 public long getCurrentTerm() {
31 public String getVotedFor() {
36 public String toString() {
37 StringBuilder builder = new StringBuilder();
38 builder.append("UpdateElectionTerm [currentTerm=").append(currentTerm).append(", votedFor=").append(votedFor)
40 return builder.toString();