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.shardmanager;
11 import com.google.common.base.Preconditions;
12 import javax.annotation.Nullable;
13 import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier;
14 import org.opendaylight.controller.cluster.raft.RaftState;
16 final class SwitchShardBehavior {
17 private final ShardIdentifier shardId;
18 private final RaftState newState;
19 private final long term;
21 SwitchShardBehavior(final ShardIdentifier shardId, final RaftState newState, final long term) {
22 this.newState = Preconditions.checkNotNull(newState);
23 this.shardId = shardId;
27 @Nullable ShardIdentifier getShardId() {
31 RaftState getNewState() {
40 public String toString() {
41 final StringBuilder sb = new StringBuilder("SwitchShardBehavior{");
42 sb.append("shardId='").append(shardId).append('\'');
43 sb.append(", newState='").append(newState).append('\'');
44 sb.append(", term=").append(term);