Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / persisted / UpdateElectionTerm.java
1 /*
2  * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.raft.persisted;
9
10 import java.io.Serializable;
11
12 /**
13  * Message class to persist election term information.
14  */
15 public final class UpdateElectionTerm implements Serializable {
16     @java.io.Serial
17     private static final long serialVersionUID = 1L;
18
19     private final long currentTerm;
20     private final String votedFor;
21
22     public UpdateElectionTerm(final long currentTerm, final String votedFor) {
23         this.currentTerm = currentTerm;
24         this.votedFor = votedFor;
25     }
26
27     public long getCurrentTerm() {
28         return currentTerm;
29     }
30
31     public String getVotedFor() {
32         return votedFor;
33     }
34
35     @Override
36     public String toString() {
37         return "UpdateElectionTerm [currentTerm=" + currentTerm + ", votedFor=" + votedFor + "]";
38     }
39
40     @java.io.Serial
41     private Object writeReplace() {
42         return new UT(this);
43     }
44 }
45