
com.alachisoft.ncache.client.internal.messaging.TopicIdentity Maven / Gradle / Ivy
package com.alachisoft.ncache.client.internal.messaging;
import com.alachisoft.ncache.runtime.caching.messaging.TopicPriority;
import com.alachisoft.ncache.runtime.caching.messaging.TopicSearchOptions;
public class TopicIdentity {
private String topicName;
private TopicSearchOptions searchOption;
private TopicPriority privateTopicPriority;
public TopicIdentity(String topicName, TopicSearchOptions searchOption, TopicPriority topicPriority) {
if (topicName == null) {
throw new IllegalArgumentException("Value cannot be null."+System.lineSeparator()+"Parameter name: topicName");
}
if (searchOption == null) {
throw new IllegalArgumentException("Value cannot be null."+System.lineSeparator()+"Parameter name: searchOptions");
}
this.setTopicName(topicName);
this.setTopicPriority(topicPriority);
this.setSearchOption(searchOption);
}
public TopicIdentity(String topicName, TopicSearchOptions searchOption) {
this(topicName, searchOption, TopicPriority.Normal);
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String value) {
topicName = value;
}
public TopicPriority getTopicPriority()
{
return privateTopicPriority;
}
public void setTopicPriority(TopicPriority value)
{
privateTopicPriority = value;
}
public TopicSearchOptions getSearchOption() {
return searchOption;
}
public void setSearchOption(TopicSearchOptions value) {
searchOption = value;
}
@Override
public int hashCode() {
return this.getTopicName().toLowerCase().hashCode();
}
@Override
public boolean equals(Object obj) {
Object other = (obj instanceof TopicIdentity) ? obj : null;
if (other == null) {
return false;
}
TopicIdentity topicIdentity = (TopicIdentity) other;
return this.getTopicName().equalsIgnoreCase(topicIdentity.getTopicName()) && this.getSearchOption() == topicIdentity.getSearchOption();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy