org.apache.openjpa.lib.conf.Value.equals()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中org.apache.openjpa.lib.conf.Value.equals()方法的一些代码示例,展示了Value.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.equals()方法的具体详情如下:
包路径:org.apache.openjpa.lib.conf.Value
类名称:Value
方法名:equals

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;
}

相关文章