okhttp3.internal.Util.equal()方法的使用及代码示例

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

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

Util.equal介绍

[英]Returns true if two possibly-null objects are equal.
[中]如果两个可能为空的对象相等,则返回true。

代码示例

代码示例来源:origin: duzechao/OKHttpUtils

@Override public boolean equals(Object o) {
 return o instanceof Challenge
   && Util.equal(scheme, ((Challenge) o).scheme)
   && Util.equal(realm, ((Challenge) o).realm);
}

代码示例来源:origin: huxq17/tractor

@Override public boolean equals(Object o) {
 return o instanceof Challenge
   && Util.equal(scheme, ((Challenge) o).scheme)
   && Util.equal(realm, ((Challenge) o).realm);
}

代码示例来源:origin: huxq17/SwipeCardsView

@Override public boolean equals(Object o) {
 return o instanceof Challenge
   && Util.equal(scheme, ((Challenge) o).scheme)
   && Util.equal(realm, ((Challenge) o).realm);
}

代码示例来源:origin: com.github.ljun20160606/okhttp

@Override public boolean equals(@Nullable Object other) {
 if (other == this) return true;
 return other instanceof CertificatePinner
   && (equal(certificateChainCleaner, ((CertificatePinner) other).certificateChainCleaner)
   && pins.equals(((CertificatePinner) other).pins));
}

代码示例来源:origin: apache/servicemix-bundles

@Override public boolean equals(@Nullable Object other) {
 if (other == this) return true;
 return other instanceof CertificatePinner
   && (equal(certificateChainCleaner, ((CertificatePinner) other).certificateChainCleaner)
   && pins.equals(((CertificatePinner) other).pins));
}

代码示例来源:origin: duzechao/OKHttpUtils

@Override public boolean equals(Object other) {
 if (other instanceof Address) {
  Address that = (Address) other;
  return this.url.equals(that.url)
    && this.dns.equals(that.dns)
    && this.proxyAuthenticator.equals(that.proxyAuthenticator)
    && this.protocols.equals(that.protocols)
    && this.connectionSpecs.equals(that.connectionSpecs)
    && this.proxySelector.equals(that.proxySelector)
    && equal(this.proxy, that.proxy)
    && equal(this.sslSocketFactory, that.sslSocketFactory)
    && equal(this.hostnameVerifier, that.hostnameVerifier)
    && equal(this.certificatePinner, that.certificatePinner);
 }
 return false;
}

代码示例来源:origin: huxq17/SwipeCardsView

@Override public boolean equals(Object other) {
 if (other instanceof Address) {
  Address that = (Address) other;
  return this.url.equals(that.url)
    && this.dns.equals(that.dns)
    && this.authenticator.equals(that.authenticator)
    && this.protocols.equals(that.protocols)
    && this.connectionSpecs.equals(that.connectionSpecs)
    && this.proxySelector.equals(that.proxySelector)
    && equal(this.proxy, that.proxy)
    && equal(this.sslSocketFactory, that.sslSocketFactory)
    && equal(this.hostnameVerifier, that.hostnameVerifier)
    && equal(this.certificatePinner, that.certificatePinner);
 }
 return false;
}

代码示例来源:origin: huxq17/tractor

@Override public boolean equals(Object other) {
 if (other instanceof Address) {
  Address that = (Address) other;
  return this.url.equals(that.url)
    && this.dns.equals(that.dns)
    && this.authenticator.equals(that.authenticator)
    && this.protocols.equals(that.protocols)
    && this.connectionSpecs.equals(that.connectionSpecs)
    && this.proxySelector.equals(that.proxySelector)
    && equal(this.proxy, that.proxy)
    && equal(this.sslSocketFactory, that.sslSocketFactory)
    && equal(this.hostnameVerifier, that.hostnameVerifier)
    && equal(this.certificatePinner, that.certificatePinner);
 }
 return false;
}

代码示例来源:origin: watson-developer-cloud/java-sdk

@Override
 public boolean equals(Object other) {
  return other instanceof Message
    && Util.equal(((Message) other).bytes, bytes)
    && Util.equal(((Message) other).string, string);
 }
}

代码示例来源:origin: apache/servicemix-bundles

/** Returns a certificate pinner that uses {@code certificateChainCleaner}. */
CertificatePinner withCertificateChainCleaner(
  @Nullable CertificateChainCleaner certificateChainCleaner) {
 return equal(this.certificateChainCleaner, certificateChainCleaner)
   ? this
   : new CertificatePinner(pins, certificateChainCleaner);
}

代码示例来源:origin: duzechao/OKHttpUtils

@Override public boolean equals(Object other) {
 if (!(other instanceof Handshake)) return false;
 Handshake that = (Handshake) other;
 return Util.equal(cipherSuite, that.cipherSuite)
   && cipherSuite.equals(that.cipherSuite)
   && peerCertificates.equals(that.peerCertificates)
   && localCertificates.equals(that.localCertificates);
}

代码示例来源:origin: com.github.ljun20160606/okhttp

boolean equalsNonHost(Address that) {
 return this.dns.equals(that.dns)
   && this.proxyAuthenticator.equals(that.proxyAuthenticator)
   && this.protocols.equals(that.protocols)
   && this.connectionSpecs.equals(that.connectionSpecs)
   && this.proxySelector.equals(that.proxySelector)
   && equal(this.proxy, that.proxy)
   && equal(this.sslSocketFactory, that.sslSocketFactory)
   && equal(this.hostnameVerifier, that.hostnameVerifier)
   && equal(this.certificatePinner, that.certificatePinner)
   && this.url().port() == that.url().port();
}

代码示例来源:origin: apache/servicemix-bundles

boolean equalsNonHost(Address that) {
 return this.dns.equals(that.dns)
   && this.proxyAuthenticator.equals(that.proxyAuthenticator)
   && this.protocols.equals(that.protocols)
   && this.connectionSpecs.equals(that.connectionSpecs)
   && this.proxySelector.equals(that.proxySelector)
   && equal(this.proxy, that.proxy)
   && equal(this.sslSocketFactory, that.sslSocketFactory)
   && equal(this.hostnameVerifier, that.hostnameVerifier)
   && equal(this.certificatePinner, that.certificatePinner)
   && this.url().port() == that.url().port();
}

代码示例来源:origin: com.github.ljun20160606/okhttp

/** Returns a certificate pinner that uses {@code certificateChainCleaner}. */
CertificatePinner withCertificateChainCleaner(
  @Nullable CertificateChainCleaner certificateChainCleaner) {
 return equal(this.certificateChainCleaner, certificateChainCleaner)
   ? this
   : new CertificatePinner(pins, certificateChainCleaner);
}

代码示例来源:origin: duzechao/OKHttpUtils

/**
 * Returns true if none of the Vary headers have changed between {@code cachedRequest} and {@code
 * newRequest}.
 */
public static boolean varyMatches(
  Response cachedResponse, Headers cachedRequest, Request newRequest) {
 for (String field : varyFields(cachedResponse)) {
  if (!equal(cachedRequest.values(field), newRequest.headers(field))) return false;
 }
 return true;
}

代码示例来源:origin: com.github.ljun20160606/okhttp

/**
 * Returns true if none of the Vary headers have changed between {@code cachedRequest} and {@code
 * newRequest}.
 */
public static boolean varyMatches(
  Response cachedResponse, Headers cachedRequest, Request newRequest) {
 for (String field : varyFields(cachedResponse)) {
  if (!equal(cachedRequest.values(field), newRequest.headers(field))) return false;
 }
 return true;
}

代码示例来源:origin: huxq17/SwipeCardsView

/**
 * Returns true if none of the Vary headers have changed between {@code
 * cachedRequest} and {@code newRequest}.
 */
public static boolean varyMatches(
  Response cachedResponse, Headers cachedRequest, Request newRequest) {
 for (String field : varyFields(cachedResponse)) {
  if (!equal(cachedRequest.values(field), newRequest.headers(field))) return false;
 }
 return true;
}

代码示例来源:origin: huxq17/tractor

/**
 * Returns true if none of the Vary headers have changed between {@code
 * cachedRequest} and {@code newRequest}.
 */
public static boolean varyMatches(
  Response cachedResponse, Headers cachedRequest, Request newRequest) {
 for (String field : varyFields(cachedResponse)) {
  if (!equal(cachedRequest.values(field), newRequest.headers(field))) return false;
 }
 return true;
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Returns true if none of the Vary headers have changed between {@code cachedRequest} and {@code
 * newRequest}.
 */
public static boolean varyMatches(
  Response cachedResponse, Headers cachedRequest, Request newRequest) {
 for (String field : varyFields(cachedResponse)) {
  if (!equal(cachedRequest.values(field), newRequest.headers(field))) return false;
 }
 return true;
}

代码示例来源:origin: huxq17/SwipeCardsView

/** Cancel all calls with the tag {@code tag}. */
public synchronized void cancel(Object tag) {
 for (AsyncCall call : readyCalls) {
  if (Util.equal(tag, call.tag())) {
   call.cancel();
  }
 }
 for (AsyncCall call : runningCalls) {
  if (Util.equal(tag, call.tag())) {
   call.get().canceled = true;
   HttpEngine engine = call.get().engine;
   if (engine != null) engine.cancel();
  }
 }
 for (Call call : executedCalls) {
  if (Util.equal(tag, call.tag())) {
   call.cancel();
  }
 }
}

相关文章