org.zodiac.sentinel.base.datasource.model.SentinelApolloDataSourceInfo Maven / Gradle / Ivy
package org.zodiac.sentinel.base.datasource.model;
import java.util.Objects;
import javax.validation.constraints.NotEmpty;
import org.zodiac.sentinel.base.datasource.DataSourceType;
import org.zodiac.sentinel.base.datasource.factory.SentinelApolloDataSourceFactoryBean;
public class SentinelApolloDataSourceInfo extends AbstractDataSourceInfo {
@NotEmpty
private String namespace;
@NotEmpty
private String flowRulesKey;
private String defaultFlowRuleValue;
public SentinelApolloDataSourceInfo() {
super(DataSourceType.apollo, SentinelApolloDataSourceFactoryBean.class.getName());
}
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
public String getFlowRulesKey() {
return flowRulesKey;
}
public void setFlowRulesKey(String flowRulesKey) {
this.flowRulesKey = flowRulesKey;
}
public String getDefaultFlowRuleValue() {
return defaultFlowRuleValue;
}
public void setDefaultFlowRuleValue(String defaultFlowRuleValue) {
this.defaultFlowRuleValue = defaultFlowRuleValue;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + Objects.hash(defaultFlowRuleValue, flowRulesKey, namespace);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
SentinelApolloDataSourceInfo other = (SentinelApolloDataSourceInfo)obj;
return Objects.equals(defaultFlowRuleValue, other.defaultFlowRuleValue)
&& Objects.equals(flowRulesKey, other.flowRulesKey) && Objects.equals(namespace, other.namespace);
}
@Override
public String toString() {
return "[namespace=" + namespace + ", flowRulesKey=" + flowRulesKey
+ ", defaultFlowRuleValue=" + defaultFlowRuleValue + ", getDataType()=" + getDataType() + ", getRule()="
+ getRule() + ", getConverterClass()=" + getConverterClass() + "]";
}
}