public static boolean equivalent(final ProtocolVersion v1, final ProtocolVersion v2) { return LangUtils.equals(v1 != null ? v1 : HttpVersion.DEFAULT, v2 != null ? v2 : HttpVersion.DEFAULT ); }
@Override public boolean matches(final Object item) { if (item instanceof MessageHeaders) { final MessageHeaders messageHeaders = (MessageHeaders) item; for (final Iterator<Header> it = messageHeaders.headerIterator(); it.hasNext(); ) { final Header header = it.next(); if (headerName.equalsIgnoreCase(header.getName()) && LangUtils.equals(headerValue, header.getValue())) { return true; } } } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof URIAuthority) { final URIAuthority that = (URIAuthority) obj; return LangUtils.equals(this.userInfo, that.userInfo) && LangUtils.equals(this.hostname, that.hostname) && this.port == that.port; } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof TimeValue) { final TimeValue that = (TimeValue) obj; return this.duration == that.duration && LangUtils.equals(this.timeUnit, that.timeUnit); } return false; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o instanceof UsernamePasswordCredentials) { final UsernamePasswordCredentials that = (UsernamePasswordCredentials) o; if (LangUtils.equals(this.principal, that.principal)) { return true; } } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof TimeValue) { final TimeValue that = (TimeValue) obj; return this.duration == that.duration && LangUtils.equals(this.timeUnit, that.timeUnit); } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof URIAuthority) { final URIAuthority that = (URIAuthority) obj; return LangUtils.equals(this.userInfo, that.userInfo) && LangUtils.equals(this.hostname, that.hostname) && this.port == that.port; } return false; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o instanceof NTUserPrincipal) { final NTUserPrincipal that = (NTUserPrincipal) o; if (LangUtils.equals(this.username, that.username) && LangUtils.equals(this.domain, that.domain)) { return true; } } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof BasicNameValuePair) { final BasicNameValuePair that = (BasicNameValuePair) obj; return this.name.equalsIgnoreCase(that.name) && LangUtils.equals(this.value, that.value); } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof BasicNameValuePair) { final BasicNameValuePair that = (BasicNameValuePair) obj; return this.name.equalsIgnoreCase(that.name) && LangUtils.equals(this.value, that.value); } return false; }
if (!LangUtils.equals(expectedRequestDate, otherRequestDate)) { return false; if (!LangUtils.equals(expectedResponseDate, otherResponseDate)) { return false; final Header h1 = expectedHeaders[i]; final Header h2 = otherHeaders[i]; if (!h1.getName().equals(h2.getName()) || !LangUtils.equals(h1.getValue(), h2.getValue())) { return false;
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof HttpHost) { final HttpHost that = (HttpHost) obj; return this.lcHostname.equals(that.lcHostname) && this.port == that.port && this.schemeName.equals(that.schemeName) && LangUtils.equals(this.address, that.address); } return false; }
public static boolean semanticallyTransparent( final ClassicHttpResponse r1, final ClassicHttpResponse r2) throws Exception { final boolean entitiesEquivalent = equivalent(r1.getEntity(), r2.getEntity()); if (!entitiesEquivalent) { return false; } final boolean statusLinesEquivalent = LangUtils.equals(r1.getReasonPhrase(), r2.getReasonPhrase()) && r1.getCode() == r2.getCode(); if (!statusLinesEquivalent) { return false; } return isEndToEndHeaderSubset(r1, r2); }
public static boolean equivalent(final HttpResponse r1, final HttpResponse r2) { return equivalent(r1.getVersion(), r2.getVersion()) && r1.getCode() == r2.getCode() && LangUtils.equals(r1.getReasonPhrase(), r2.getReasonPhrase()) && isEndToEndHeaderSubset(r1, r2); }
private int findFullMatch(final List<HPackEntry> entries, final String value) { if (entries == null || entries.isEmpty()) { return 0; } for (int i = 0; i < entries.size(); i++) { final HPackEntry entry = entries.get(i); if (LangUtils.equals(value, entry.getHeader().getValue())) { return entry.getIndex(); } } return 0; }
private boolean headerEquals(final Header header1, final Header header2) { return header2 == header1 || header2.getName().equalsIgnoreCase(header1.getName()) && LangUtils.equals(header1.getValue(), header2.getValue()); }
private PoolEntry<T, C> getAvailableEntry(final Object state) { final PoolEntry<T, C> entry = available.poll(); if (entry != null) { if (entry.getExpiryDeadline().isExpired()) { entry.discardConnection(CloseMode.GRACEFUL); } if (!LangUtils.equals(entry.getState(), state)) { entry.discardConnection(CloseMode.GRACEFUL); } } return entry; }
private PoolEntry<T, C> getAvailableEntry(final Object state) { final PoolEntry<T, C> entry = available.poll(); if (entry != null) { if (entry.getExpiryDeadline().isExpired()) { entry.discardConnection(CloseMode.GRACEFUL); } if (!LangUtils.equals(entry.getState(), state)) { entry.discardConnection(CloseMode.GRACEFUL); } } return entry; }