本文整理了Java中org.apache.openjpa.lib.conf.Value.equals()
方法的一些代码示例,展示了Value.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.equals()
方法的具体详情如下:
包路径:org.apache.openjpa.lib.conf.Value
类名称:Value
方法名:equals
[英]Use #getOriginalValue() instead of #getString() because they are one and the same for non-dynamic Values and ensures that modifying dynamic Values do not impact equality or hashCode contract.
[中]使用#getOriginalValue()而不是#getString(),因为它们对于非动态值是一个相同的值,并确保修改动态值不会影响相等或哈希代码约定。
代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa
/**
* Performs an equality check based on equality of values.
* {@link Value#equals(Object) Equality} of Values varies if the Value is
* {@link Value#isDynamic() dynamic}.
*/
public boolean equals(Object other) {
if (other == this)
return true;
if (other == null)
return false;
if (!getClass().equals(other.getClass()))
return false;
// compare properties
ConfigurationImpl conf = (ConfigurationImpl) other;
if (_vals.size() != conf.getValues().length)
return false;
Iterator values = _vals.iterator();
while (values.hasNext()) {
Value v = (Value)values.next();
Value thatV = conf.getValue(v.getProperty());
if (!v.equals(thatV)) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.openejb.patch/openjpa
/**
* Performs an equality check based on equality of values.
* {@link Value#equals(Object) Equality} of Values varies if the Value is
* {@link Value#isDynamic() dynamic}.
*/
public boolean equals(Object other) {
if (other == this)
return true;
if (other == null)
return false;
if (!getClass().equals(other.getClass()))
return false;
// compare properties
ConfigurationImpl conf = (ConfigurationImpl) other;
if (_vals.size() != conf.getValues().length)
return false;
for(Value v : _vals) {
String propName = v.getProperty();
Value thisV = this.getValue(propName);
Value thatV = conf.getValue(propName);
if (!thisV.equals(thatV)) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.openjpa/openjpa-lib
/**
* Performs an equality check based on equality of values.
* {@link Value#equals(Object) Equality} of Values varies if the Value is
* {@link Value#isDynamic() dynamic}.
*/
public boolean equals(Object other) {
if (other == this)
return true;
if (other == null)
return false;
if (!getClass().equals(other.getClass()))
return false;
// compare properties
ConfigurationImpl conf = (ConfigurationImpl) other;
if (_vals.size() != conf.getValues().length)
return false;
for(Value v : _vals) {
String propName = v.getProperty();
Value thisV = this.getValue(propName);
Value thatV = conf.getValue(propName);
if (!thisV.equals(thatV)) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
/**
* Performs an equality check based on equality of values.
* {@link Value#equals(Object) Equality} of Values varies if the Value is
* {@link Value#isDynamic() dynamic}.
*/
public boolean equals(Object other) {
if (other == this)
return true;
if (other == null)
return false;
if (!getClass().equals(other.getClass()))
return false;
// compare properties
ConfigurationImpl conf = (ConfigurationImpl) other;
if (_vals.size() != conf.getValues().length)
return false;
for(Value v : _vals) {
String propName = v.getProperty();
Value thisV = this.getValue(propName);
Value thatV = conf.getValue(propName);
if (!thisV.equals(thatV)) {
return false;
}
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!