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

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

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

Value.hashCode介绍

[英]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.openejb.patch/openjpa

/**
 * Computes hash code based on the hashCodes of the values.
 * {@link Value#hashCode() HashCode} of a Value varies if the Value is
 * {@link Value#isDynamic() dynamic}.  
 */
public int hashCode() {
  int hash = 0;
  for(Value v : _vals) { 
    hash += v.hashCode();
  }
  return hash;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Computes hash code based on the hashCodes of the values.
 * {@link Value#hashCode() HashCode} of a Value varies if the Value is
 * {@link Value#isDynamic() dynamic}.  
 */
public int hashCode() {
  int hash = 0;
  for(Value v : _vals) { 
    hash += v.hashCode();
  }
  return hash;
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Computes hash code based on the hashCodes of the values.
 * {@link Value#hashCode() HashCode} of a Value varies if the Value is
 * {@link Value#isDynamic() dynamic}.  
 */
public int hashCode() {
  int hash = 0;
  for(Value v : _vals) { 
    hash += v.hashCode();
  }
  return hash;
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Computes hash code based on the hashCodes of the values.
 * {@link Value#hashCode() HashCode} of a Value varies if the Value is
 * {@link Value#isDynamic() dynamic}.  
 */
public int hashCode() {
  Iterator values = _vals.iterator();
  int hash = 0;
  while (values.hasNext()) {
    Value v = (Value)values.next();
    hash += v.hashCode();
  }
  return hash;
}

相关文章