2 * Copyright (c) 2014 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;
13 public class PrimaryNotFound implements SerializableMessage {
14 public static final Class<PrimaryNotFound> SERIALIZABLE_CLASS = PrimaryNotFound.class;
16 private final String shardName;
18 public PrimaryNotFound(final String shardName){
20 Preconditions.checkNotNull(shardName, "shardName should not be null");
22 this.shardName = shardName;
26 public boolean equals(final Object o) {
30 if (o == null || getClass() != o.getClass()) {
34 PrimaryNotFound that = (PrimaryNotFound) o;
36 if (shardName != null ? !shardName.equals(that.shardName) : that.shardName != null) {
44 public int hashCode() {
45 return shardName != null ? shardName.hashCode() : 0;
49 public Object toSerializable() {
53 public static PrimaryNotFound fromSerializable(final Object message){
54 return (PrimaryNotFound) message;