2 * Copyright (c) 2015 Cisco 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
9 package org.opendaylight.controller.cluster.datastore.messages;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.controller.cluster.raft.RaftState;
14 public final class SwitchShardBehavior {
15 private final String shardName;
16 private final RaftState newState;
17 private final long term;
19 public SwitchShardBehavior(String shardName, RaftState newState, long term) {
20 this.shardName = Preconditions.checkNotNull(shardName);
21 this.newState = Preconditions.checkNotNull(newState);
25 public String getShardName() {
29 public RaftState getNewState() {
33 public long getTerm() {
38 public String toString() {
39 final StringBuilder sb = new StringBuilder("SwitchShardBehavior{");
40 sb.append("shardName='").append(shardName).append('\'');
41 sb.append(", newState='").append(newState).append('\'');
42 sb.append(", term=").append(term);