com.dooapp.gaedo.prevalence.space.commands.Contains Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gaedo-prevalence Show documentation
Show all versions of gaedo-prevalence Show documentation
A gaedo-inspired prevalence layer and the associated service, for making the most gaedo-efficient use of that layer
package com.dooapp.gaedo.prevalence.space.commands;
import java.io.Serializable;
import com.dooapp.gaedo.prevalence.space.Command;
import com.dooapp.gaedo.prevalence.space.StorageSpace;
public class Contains implements Command {
private Key key;
public Contains(Key key) {
super();
this.key = key;
}
@Override
public Boolean execute(StorageSpace storage) {
return storage.contains(key);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((key == null) ? 0 : key.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Contains other = (Contains) obj;
if (key == null) {
if (other.key != null)
return false;
} else if (!key.equals(other.key))
return false;
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy