import com.google.common.base.Preconditions;
-public class PrimaryNotFound {
+public class PrimaryNotFound implements SerializableMessage {
+ public static final Class<PrimaryNotFound> SERIALIZABLE_CLASS = PrimaryNotFound.class;
private final String shardName;
- public PrimaryNotFound(String shardName){
+ public PrimaryNotFound(final String shardName){
Preconditions.checkNotNull(shardName, "shardName should not be null");
}
@Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
PrimaryNotFound that = (PrimaryNotFound) o;
- if (shardName != null ? !shardName.equals(that.shardName) : that.shardName != null) return false;
+ if (shardName != null ? !shardName.equals(that.shardName) : that.shardName != null) {
+ return false;
+ }
return true;
}
public int hashCode() {
return shardName != null ? shardName.hashCode() : 0;
}
+
+ @Override
+ public Object toSerializable() {
+ return this;
+ }
+
+ public static PrimaryNotFound fromSerializable(final Object message){
+ return (PrimaryNotFound) message;
+ }
}