java.util.Set.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(182)

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

Set.hashCode介绍

[英]Returns the hash code for this set. Two set which are equal must return the same value.
[中]返回此集合的哈希代码。两个相等的集合必须返回相同的值。

代码示例

代码示例来源:origin: apache/incubator-druid

@Override
public int hashCode()
{
 int result = dimensions.hashCode();
 result = 31 * result + dimensionExclusions.hashCode();
 return result;
}

代码示例来源:origin: apache/incubator-druid

@Override
public int hashCode()
{
 int result = pagingIdentifiers != null ? pagingIdentifiers.hashCode() : 0;
 result = 31 * result + (dimensions != null ? dimensions.hashCode() : 0);
 result = 31 * result + (metrics != null ? metrics.hashCode() : 0);
 result = 31 * result + (events != null ? events.hashCode() : 0);
 return result;
}

代码示例来源:origin: robolectric/robolectric

@Override
public int hashCode() {
 if (cachedHashCode != 0) {
  return cachedHashCode;
 }
 int result = instrumentedPackages.hashCode();
 result = 31 * result + instrumentedClasses.hashCode();
 result = 31 * result + classNameTranslations.hashCode();
 result = 31 * result + interceptedMethods.hashCode();
 result = 31 * result + classesToNotAcquire.hashCode();
 cachedHashCode = result;
 return result;
}

代码示例来源:origin: airbnb/epoxy

@Override
 public int hashCode() {
  int result = name != null ? name.hashCode() : 0;
  result = 31 * result + (modifiers != null ? modifiers.hashCode() : 0);
  result = 31 * result + (params != null ? params.hashCode() : 0);
  result = 31 * result + (varargs ? 1 : 0);
  return result;
 }
}

代码示例来源:origin: apache/kylin

public int calculateNonFilterHashCode() {
  int result = sqlDigest.factTable != null ? sqlDigest.factTable.hashCode() : 0;
  result = 31 * result + (sqlDigest.joinDescs != null ? sqlDigest.joinDescs.hashCode() : 0);
  result = 31 * result + (sqlDigest.allColumns != null ? sqlDigest.allColumns.hashCode() : 0);
  result = 31 * result + (sqlDigest.groupbyColumns != null ? sqlDigest.groupbyColumns.hashCode() : 0);
  result = 31 * result + (sqlDigest.filterColumns != null ? sqlDigest.filterColumns.hashCode() : 0);
  result = 31 * result + (sqlDigest.metricColumns != null ? sqlDigest.metricColumns.hashCode() : 0);
  result = 31 * result + (sqlDigest.aggregations != null ? sqlDigest.aggregations.hashCode() : 0);
  return result;
}

代码示例来源:origin: apache/geode

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + (checkPortability ? 1231 : 1237);
 result = prime * result + ((classPatterns == null) ? 0 : classPatterns.hashCode());
 result = prime * result + ((excludePatterns == null) ? 0 : excludePatterns.hashCode());
 result = prime * result + ((identityPatterns == null) ? 0 : identityPatterns.hashCode());
 return result;
}

代码示例来源:origin: jersey/jersey

@Override
  public int hashCode() {
    int result = type.hashCode();
    result = 31 * result + properties.hashCode();
    result = 31 * result + componentBag.hashCode();
    result = 31 * result + newFeatureRegistrations.hashCode();
    result = 31 * result + enabledFeatures.hashCode();
    result = 31 * result + enabledFeatureClasses.hashCode();
    return result;
  }
}

代码示例来源:origin: jersey/jersey

@Override
  public int hashCode() {
    int result = type.hashCode();
    result = 31 * result + properties.hashCode();
    result = 31 * result + componentBag.hashCode();
    result = 31 * result + newFeatureRegistrations.hashCode();
    result = 31 * result + enabledFeatures.hashCode();
    result = 31 * result + enabledFeatureClasses.hashCode();
    return result;
  }
}

代码示例来源:origin: spring-projects/spring-security-oauth

: refreshTokenValiditySeconds);
result = prime * result
    + ((authorities == null) ? 0 : authorities.hashCode());
result = prime
        .hashCode());
result = prime * result
    + ((clientId == null) ? 0 : clientId.hashCode());
        : registeredRedirectUris.hashCode());
result = prime * result
    + ((resourceIds == null) ? 0 : resourceIds.hashCode());
result = prime * result + ((scope == null) ? 0 : scope.hashCode());
result = prime * result + ((additionalInformation == null) ? 0 : additionalInformation.hashCode());
return result;

代码示例来源:origin: aws/aws-sdk-java

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((owner == null) ? 0 : owner.hashCode());
  result = prime * result + ((grantSet == null) ? 0 : grantSet.hashCode());
  result = prime * result + ((grantList == null) ? 0 : grantList.hashCode());
  return result;
}

代码示例来源:origin: hibernate/hibernate-orm

public NativeSQLQuerySpecification(
    String queryString,
    NativeSQLQueryReturn[] queryReturns,
    Collection querySpaces) {
  this.queryString = queryString;
  this.queryReturns = queryReturns;
  if ( querySpaces == null ) {
    this.querySpaces = Collections.EMPTY_SET;
  }
  else {
    Set tmp = new HashSet();
    tmp.addAll( querySpaces );
    this.querySpaces = Collections.unmodifiableSet( tmp );
  }
  // pre-determine and cache the hashcode
  int hashCode = queryString.hashCode();
  hashCode = 29 * hashCode + this.querySpaces.hashCode();
  if ( this.queryReturns != null ) {
    hashCode = 29 * hashCode + ArrayHelper.toList( this.queryReturns ).hashCode();
  }
  this.hashCode = hashCode;
}

代码示例来源:origin: geoserver/geoserver

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((defaultStyle == null) ? 0 : defaultStyle.hashCode());
  result = prime * result + ((id == null) ? 0 : id.hashCode());
  result = prime * result + ((legend == null) ? 0 : legend.hashCode());
  // TODO: add back when resource publish split is in place
  // result = prime * result + ((name == null) ? 0 : name.hashCode());
  result = prime * result + ((path == null) ? 0 : path.hashCode());
  result = prime * result + ((resource == null) ? 0 : resource.hashCode());
  result = prime * result + ((styles == null) ? 0 : styles.hashCode());
  result = prime * result + ((type == null) ? 0 : type.hashCode());
  result = prime * result + ((attribution == null) ? 0 : attribution.hashCode());
  result = prime * result + ((authorityURLs == null) ? 0 : authorityURLs.hashCode());
  result = prime * result + ((identifiers == null) ? 0 : identifiers.hashCode());
  return result;
}

代码示例来源:origin: protostuff/protostuff

@Override
public int hashCode()
{
  int result = list != null ? list.hashCode() : 0;
  result = 31 * result + (map != null ? map.hashCode() : 0);
  result = 31 * result + (set != null ? set.hashCode() : 0);
  return result;
}

代码示例来源:origin: apache/incubator-druid

@Override
 public int hashCode()
 {
  int result = getName() != null ? getName().hashCode() : 0;
  result = 31 * result + (getUsers() != null ? getUsers().hashCode() : 0);
  result = 31 * result + (getPermissions() != null ? getPermissions().hashCode() : 0);
  return result;
 }
}

代码示例来源:origin: wildfly/wildfly

@Override
public int hashCode() {
  int result = getTemplateString() != null ? getTemplateString().hashCode() : 0;
  result = 31 * result + (template ? 1 : 0);
  result = 31 * result + (getBase() != null ? getBase().hashCode() : 0);
  result = 31 * result + (parts != null ? parts.hashCode() : 0);
  result = 31 * result + (getParameterNames() != null ? getParameterNames().hashCode() : 0);
  return result;
}

代码示例来源:origin: geoserver/geoserver

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + (isConstant() ? 1231 : 1237);
  result = prime * result + (isAllowSessionCreation() ? 17 : 19);
  result = prime * result + (isDisabled() ? 23 : 29);
  result = prime * result + (isRequireSSL() ? 31 : 37);
  result = prime * result + (isMatchHTTPMethod() ? 41 : 49);
  result = prime * ((roleFilterName == null) ? 1 : roleFilterName.hashCode());
  result = prime * result + ((httpMethods == null) ? 0 : httpMethods.hashCode());
  result = prime * result + ((filterNames == null) ? 0 : filterNames.hashCode());
  result = prime * result + ((name == null) ? 0 : name.hashCode());
  result = prime * result + ((patterns == null) ? 0 : patterns.hashCode());
  return result;
}

代码示例来源:origin: MorphiaOrg/morphia

@Override
  public int hashCode() {
    int result = id != null ? id.hashCode() : 0;
    result = 31 * result + Arrays.hashCode(arrayOfStrings);
    result = 31 * result + Arrays.hashCode(arrayOfInts);
    result = 31 * result + (listOfStrings != null ? listOfStrings.hashCode() : 0);
    result = 31 * result + (listOfIntegers != null ? listOfIntegers.hashCode() : 0);
    result = 31 * result + (arrayListOfStrings != null ? arrayListOfStrings.hashCode() : 0);
    result = 31 * result + (arrayListOfIntegers != null ? arrayListOfIntegers.hashCode() : 0);
    result = 31 * result + (listEmbeddedType != null ? listEmbeddedType.hashCode() : 0);
    result = 31 * result + (setOfIntegers != null ? setOfIntegers.hashCode() : 0);
    result = 31 * result + (notAnArrayOrList != null ? notAnArrayOrList.hashCode() : 0);
    return result;
  }
}

代码示例来源:origin: protostuff/protostuff

result = prime * result
    + ((linkedList == null) ? 0 : linkedList.hashCode());
result = prime * result + ((list == null) ? 0 : list.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result
    + ((priorityQueue == null) ? 0 : priorityQueue.hashCode());
result = prime * result + ((queue == null) ? 0 : queue.hashCode());
result = prime * result + ((set == null) ? 0 : set.hashCode());
result = prime * result
    + ((sortedSet == null) ? 0 : sortedSet.hashCode());

代码示例来源:origin: apache/phoenix

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + children.hashCode() + values.hashCode();
  return result;
}

代码示例来源:origin: line/armeria

@Override
public int hashCode() {
 int hashCode = 1;
 hashCode = hashCode * 8191 + ((isSetFoo1()) ? 131071 : 524287);
 if (isSetFoo1())
  hashCode = hashCode * 8191 + foo1.hashCode();
 hashCode = hashCode * 8191 + ((isSetFoo2()) ? 131071 : 524287);
 if (isSetFoo2())
  hashCode = hashCode * 8191 + foo2.hashCode();
 hashCode = hashCode * 8191 + ((isSetFoo3()) ? 131071 : 524287);
 if (isSetFoo3())
  hashCode = hashCode * 8191 + foo3.getValue();
 hashCode = hashCode * 8191 + ((isSetFoo4()) ? 131071 : 524287);
 if (isSetFoo4())
  hashCode = hashCode * 8191 + foo4.hashCode();
 hashCode = hashCode * 8191 + ((isSetFoo5()) ? 131071 : 524287);
 if (isSetFoo5())
  hashCode = hashCode * 8191 + foo5.hashCode();
 hashCode = hashCode * 8191 + ((isSetFoo6()) ? 131071 : 524287);
 if (isSetFoo6())
  hashCode = hashCode * 8191 + foo6.hashCode();
 hashCode = hashCode * 8191 + ((isSetFoo7()) ? 131071 : 524287);
 if (isSetFoo7())
  hashCode = hashCode * 8191 + foo7.hashCode();
 hashCode = hashCode * 8191 + ((isSetFoo8()) ? 131071 : 524287);
 if (isSetFoo8())
  hashCode = hashCode * 8191 + foo8.hashCode();
 return hashCode;
}

相关文章