/*
 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.controller.cluster.raft.client.messages;

import java.beans.ConstructorProperties;

/**
 * A bean class containing a snapshot of information for a follower returned from GetOnDemandRaftStats.
 *
 * @author Thomas Pantelis
 */
public class FollowerInfo {
    private final String id;
    private final long nextIndex;
    private final long matchIndex;
    private final boolean isActive;
    private final String timeSinceLastActivity;
    private final boolean isVoting;

    @ConstructorProperties({"id","nextIndex", "matchIndex", "isActive", "timeSinceLastActivity", "isVoting"})
    public FollowerInfo(String id, long nextIndex, long matchIndex, boolean isActive, String timeSinceLastActivity,
            boolean isVoting) {
        this.id = id;
        this.nextIndex = nextIndex;
        this.matchIndex = matchIndex;
        this.isActive = isActive;
        this.timeSinceLastActivity = timeSinceLastActivity;
        this.isVoting = isVoting;
    }

    public String getId() {
        return id;
    }

    public long getNextIndex() {
        return nextIndex;
    }

    public long getMatchIndex() {
        return matchIndex;
    }

    public boolean isActive() {
        return isActive;
    }

    public String getTimeSinceLastActivity() {
        return timeSinceLastActivity;
    }

    public boolean isVoting() {
        return isVoting;
    }
}

@@ -877,19 +877,17 @@
 ndex%22, %22
-isA
+a
 ctive%22, 
@@ -912,19 +912,17 @@
 vity%22, %22
-isV
+v
 oting%22%7D)
@@ -994,27 +994,25 @@
 ex, boolean 
-isA
+a
 ctive, Strin
@@ -1052,27 +1052,25 @@
     boolean 
-isV
+v
 oting) %7B%0A   
@@ -1186,19 +1186,17 @@
 ctive = 
-isA
+a
 ctive;%0A 
@@ -1278,19 +1278,17 @@
 oting = 
-isV
+v
 oting;%0A 

fix FollowerInfo @ConstructorProperties for valid ShardStatsMXBean