java.net.URL.hashCode()方法的使用及代码示例

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

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

URL.hashCode介绍

[英]The cached hash code, or 0 if it hasn't been computed yet. Unlike the RI, this implementation's hashCode is transient because the hash code is unspecified and may vary between VMs or versions.
[中]

代码示例

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

/**
 * This implementation returns the hash code of the underlying URL reference.
 */
@Override
public int hashCode() {
  return this.cleanedUrl.hashCode();
}

代码示例来源:origin: org.springframework/spring-core

/**
 * This implementation returns the hash code of the underlying URL reference.
 */
@Override
public int hashCode() {
  return this.cleanedUrl.hashCode();
}

代码示例来源:origin: micronaut-projects/micronaut-core

/**
 * This implementation returns the hash code of the underlying URL reference.
 */
@Override
public int hashCode() {
  return cleanedUrl.hashCode();
}

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

@Override
@SuppressFBWarnings(value = "DMI_BLOCKING_METHODS_ON_URL", justification = "Package sealing relies on URL equality")
public int hashCode() {
  return sealBase.hashCode();
}

代码示例来源:origin: org.freemarker/freemarker

@Override
public int hashCode() {
  return url.hashCode();
}

代码示例来源:origin: HotswapProjects/HotswapAgent

@Override
public int hashCode() {
  return this.url.hashCode();
}

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

static int f(URL u) {
  return u.hashCode();
}

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

@Override
public int hashCode() {
  int result = prefix != null ? prefix.hashCode() : 0;
  result = 31 * result + (uri != null ? uri.hashCode() : 0);
  result = 31 * result + (xsdResource != null ? xsdResource.hashCode() : 0);
  return result;
}

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

@Override
@SuppressFBWarnings(value = "DMI_BLOCKING_METHODS_ON_URL", justification = "Package sealing relies on URL equality")
public int hashCode() {
  int result = specificationTitle != null ? specificationTitle.hashCode() : 0;
  result = 31 * result + (specificationVersion != null ? specificationVersion.hashCode() : 0);
  result = 31 * result + (specificationVendor != null ? specificationVendor.hashCode() : 0);
  result = 31 * result + (implementationTitle != null ? implementationTitle.hashCode() : 0);
  result = 31 * result + (implementationVersion != null ? implementationVersion.hashCode() : 0);
  result = 31 * result + (implementationVendor != null ? implementationVendor.hashCode() : 0);
  result = 31 * result + (sealBase != null ? sealBase.hashCode() : 0);
  return result;
}

代码示例来源:origin: HotswapProjects/HotswapAgent

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

代码示例来源:origin: spring-io/initializr

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
  result = prime * result + (this.snapshotsEnabled ? 1231 : 1237);
  result = prime * result + ((this.url == null) ? 0 : this.url.hashCode());
  return result;
}

代码示例来源:origin: org.netbeans.api/org-openide-util

@Override
public int hashCode() {
  int base = HelpCtx.class.hashCode();
  if (helpCtx != null) {
    base ^= helpCtx.hashCode();
  }
  if (helpID != null) {
    base ^= helpID.hashCode();
  }
  return base;
}

代码示例来源:origin: cloudfoundry/uaa

@Override
  public int hashCode() {
    int result = super.hashCode();
    result = 31 * result + (userInfoUrl != null ? userInfoUrl.hashCode() : 0);
    result = 31 * result + (discoveryUrl != null ? discoveryUrl.hashCode() : 0);
    result = 31 * result + (passwordGrantEnabled ? 1 : 0);
    return result;
  }
}

代码示例来源:origin: wiztools/rest-client

@Override
public int hashCode() {
  int hash = 7;
  hash = 23 * hash + (this.url != null ? this.url.hashCode() : 0);
  hash = 23 * hash + (this.method != null ? this.method.hashCode() : 0);
  hash = 23 * hash + (this.auth != null ? this.auth.hashCode() : 0);
  hash = 23 * hash + (this.headers != null ? this.headers.hashCode() : 0);
  hash = 23 * hash + (this.cookies != null ? this.cookies.hashCode() : 0);
  hash = 23 * hash + (this.body != null ? this.body.hashCode() : 0);
  hash = 23 * hash + (this.testScript != null ? this.testScript.hashCode() : 0);
  hash = 23 * hash + (this.sslReq != null ? this.sslReq.hashCode() : 0);
  hash = 23 * hash + (this.httpVersion != null ? this.httpVersion.hashCode() : 0);
  hash = 23 * hash + (this.isFollowRedirect ? 1 : 0);
  hash = 23 * hash + (this.isIgnoreResponseBody ? 1 : 0);
  return hash;
}

代码示例来源:origin: looly/hutool

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((charset == null) ? 0 : charset.hashCode());
  result = prime * result + ((groupedMap == null) ? 0 : groupedMap.hashCode());
  result = prime * result + (isUseVariable ? 1231 : 1237);
  result = prime * result + ((settingUrl == null) ? 0 : settingUrl.hashCode());
  return result;
}

代码示例来源:origin: looly/hutool

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((charset == null) ? 0 : charset.hashCode());
  result = prime * result + ((groupedMap == null) ? 0 : groupedMap.hashCode());
  result = prime * result + (isUseVariable ? 1231 : 1237);
  result = prime * result + ((settingUrl == null) ? 0 : settingUrl.hashCode());
  return result;
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Get the hash code for this Resource.
 * @return hash code as int.
 */
public synchronized int hashCode() {
  if (isReference()) {
    return getCheckedRef().hashCode();
  }
  return MAGIC * ((getURL() == null) ? NULL_URL : getURL().hashCode());
}

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

/** {@inheritDoc} */
  @SuppressWarnings("EqualsHashCodeCalledOnUrl")
  @Override public int hashCode() {
    int res = id;
    res = 31 * res + (boolVal != null ? boolVal.hashCode() : 0);
    res = 31 * res + (byteVal != null ? byteVal.hashCode() : 0);
    res = 31 * res + (shortVal != null ? shortVal.hashCode() : 0);
    res = 31 * res + (intVal != null ? intVal.hashCode() : 0);
    res = 31 * res + (longVal != null ? longVal.hashCode() : 0);
    res = 31 * res + (floatVal != null ? floatVal.hashCode() : 0);
    res = 31 * res + (doubleVal != null ? doubleVal.hashCode() : 0);
    res = 31 * res + (bigVal != null ? bigVal.hashCode() : 0);
    res = 31 * res + (strVal != null ? strVal.hashCode() : 0);
    res = 31 * res + (arrVal != null ? Arrays.hashCode(arrVal) : 0);
    res = 31 * res + (dateVal != null ? dateVal.hashCode() : 0);
    res = 31 * res + (timeVal != null ? timeVal.hashCode() : 0);
    res = 31 * res + (tsVal != null ? tsVal.hashCode() : 0);
    res = 31 * res + (urlVal != null ? urlVal.hashCode() : 0);
    res = 31 * res + (f1 != null ? f1.hashCode() : 0);
    res = 31 * res + (f2 != null ? f2.hashCode() : 0);
    res = 31 * res + (f3 != null ? f3.hashCode() : 0);
    return res;
  }
}

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

/** {@inheritDoc} */
  @SuppressWarnings("EqualsHashCodeCalledOnUrl")
  @Override public int hashCode() {
    int res = id;
    res = 31 * res + (boolVal != null ? boolVal.hashCode() : 0);
    res = 31 * res + (byteVal != null ? byteVal.hashCode() : 0);
    res = 31 * res + (shortVal != null ? shortVal.hashCode() : 0);
    res = 31 * res + (intVal != null ? intVal.hashCode() : 0);
    res = 31 * res + (longVal != null ? longVal.hashCode() : 0);
    res = 31 * res + (floatVal != null ? floatVal.hashCode() : 0);
    res = 31 * res + (doubleVal != null ? doubleVal.hashCode() : 0);
    res = 31 * res + (bigVal != null ? bigVal.hashCode() : 0);
    res = 31 * res + (strVal != null ? strVal.hashCode() : 0);
    res = 31 * res + (arrVal != null ? Arrays.hashCode(arrVal) : 0);
    res = 31 * res + (dateVal != null ? dateVal.hashCode() : 0);
    res = 31 * res + (timeVal != null ? timeVal.hashCode() : 0);
    res = 31 * res + (tsVal != null ? tsVal.hashCode() : 0);
    res = 31 * res + (urlVal != null ? urlVal.hashCode() : 0);
    res = 31 * res + (f1 != null ? f1.hashCode() : 0);
    res = 31 * res + (f2 != null ? f2.hashCode() : 0);
    res = 31 * res + (f3 != null ? f3.hashCode() : 0);
    return res;
  }
}

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

/** {@inheritDoc} */
  @SuppressWarnings("EqualsHashCodeCalledOnUrl")
  @Override public int hashCode() {
    int res = id;
    res = 31 * res + (boolVal != null ? boolVal.hashCode() : 0);
    res = 31 * res + (byteVal != null ? byteVal.hashCode() : 0);
    res = 31 * res + (shortVal != null ? shortVal.hashCode() : 0);
    res = 31 * res + (intVal != null ? intVal.hashCode() : 0);
    res = 31 * res + (longVal != null ? longVal.hashCode() : 0);
    res = 31 * res + (floatVal != null ? floatVal.hashCode() : 0);
    res = 31 * res + (doubleVal != null ? doubleVal.hashCode() : 0);
    res = 31 * res + (bigVal != null ? bigVal.hashCode() : 0);
    res = 31 * res + (strVal != null ? strVal.hashCode() : 0);
    res = 31 * res + (arrVal != null ? Arrays.hashCode(arrVal) : 0);
    res = 31 * res + (dateVal != null ? dateVal.hashCode() : 0);
    res = 31 * res + (timeVal != null ? timeVal.hashCode() : 0);
    res = 31 * res + (tsVal != null ? tsVal.hashCode() : 0);
    res = 31 * res + (urlVal != null ? urlVal.hashCode() : 0);
    res = 31 * res + (f1 != null ? f1.hashCode() : 0);
    res = 31 * res + (f2 != null ? f2.hashCode() : 0);
    res = 31 * res + (f3 != null ? f3.hashCode() : 0);
    return res;
  }
}

相关文章