Alachisoft.NCache.Common.Messaging.SubscriptionIdentifier Maven / Gradle / Ivy
package Alachisoft.NCache.Common.Messaging;
import com.alachisoft.ncache.runtime.caching.SubscriptionPolicyType;
public class SubscriptionIdentifier implements Cloneable {
private String subscriptionName;
private SubscriptionPolicyType subscriptionPolicy;
public SubscriptionIdentifier() {
}
public SubscriptionIdentifier(String subscriptionName, SubscriptionPolicyType subscriptionPolicy) {
this.subscriptionName = subscriptionName;
this.subscriptionPolicy = subscriptionPolicy;
}
public final String getSubscriptionName() {
return subscriptionName;
}
public final void setSubscriptionName(String value) {
subscriptionName = value;
}
public final SubscriptionPolicyType getSubscriptionPolicy() {
return subscriptionPolicy;
}
public final void setSubscriptionPolicy(SubscriptionPolicyType value) {
subscriptionPolicy = value;
}
@Override
public int hashCode() {
String hashcode = getSubscriptionName() + getSubscriptionPolicy();
return hashcode.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof SubscriptionIdentifier) {
SubscriptionIdentifier other = (SubscriptionIdentifier) ((obj instanceof SubscriptionIdentifier) ? obj : null);
if (this.getSubscriptionName().compareToIgnoreCase(other.getSubscriptionName()) == 0 && this.getSubscriptionPolicy() == other.getSubscriptionPolicy()) {
return true;
}
}
return false;
}
public final Object clone() {
SubscriptionIdentifier subscriptionId = new SubscriptionIdentifier();
subscriptionId.setSubscriptionName(this.subscriptionName);
subscriptionId.setSubscriptionPolicy(this.subscriptionPolicy);
return subscriptionId;
}
}