本文整理汇总了Java中org.apache.http.util.LangUtils类的典型用法代码示例。如果您正苦于以下问题:Java LangUtils类的具体用法?Java LangUtils怎么用?Java LangUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LangUtils类属于org.apache.http.util包,在下文中一共展示了LangUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* @see java.lang.Object#equals(Object)
*/
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (o == this) {
return true;
}
if (!(o instanceof AuthScope)) {
return super.equals(o);
}
AuthScope that = (AuthScope) o;
return
LangUtils.equals(this.host, that.host)
&& this.port == that.port
&& LangUtils.equals(this.realm, that.realm)
&& LangUtils.equals(this.scheme, that.scheme);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AuthScope.java
示例2: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Compares this route to another.
*
* @param obj the object to compare with
*
* @return <code>true</code> if the argument is the same route,
* <code>false</code>
*/
@Override
public final boolean equals(Object obj) {
if (this == obj) return true;
if (obj instanceof HttpRoute) {
HttpRoute that = (HttpRoute) obj;
return
// Do the cheapest tests first
(this.secure == that.secure) &&
(this.tunnelled == that.tunnelled) &&
(this.layered == that.layered) &&
LangUtils.equals(this.targetHost, that.targetHost) &&
LangUtils.equals(this.localAddress, that.localAddress) &&
LangUtils.equals(this.proxyChain, that.proxyChain);
} else {
return false;
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:HttpRoute.java
示例3: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Compares this tracked route to another.
*
* @param o the object to compare with
*
* @return <code>true</code> if the argument is the same tracked route,
* <code>false</code>
*/
@Override
public final boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof RouteTracker))
return false;
RouteTracker that = (RouteTracker) o;
return
// Do the cheapest checks first
(this.connected == that.connected) &&
(this.secure == that.secure) &&
(this.tunnelled == that.tunnelled) &&
(this.layered == that.layered) &&
LangUtils.equals(this.targetHost, that.targetHost) &&
LangUtils.equals(this.localAddress, that.localAddress) &&
LangUtils.equals(this.proxyChain, that.proxyChain);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:RouteTracker.java
示例4: hashCode
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Generates a hash code for this tracked route.
* Route trackers are modifiable and should therefore not be used
* as lookup keys. Use {@link #toRoute toRoute} to obtain an
* unmodifiable representation of the tracked route.
*
* @return the hash code
*/
@Override
public final int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.targetHost);
hash = LangUtils.hashCode(hash, this.localAddress);
if (this.proxyChain != null) {
for (int i = 0; i < this.proxyChain.length; i++) {
hash = LangUtils.hashCode(hash, this.proxyChain[i]);
}
}
hash = LangUtils.hashCode(hash, this.connected);
hash = LangUtils.hashCode(hash, this.secure);
hash = LangUtils.hashCode(hash, this.tunnelled);
hash = LangUtils.hashCode(hash, this.layered);
return hash;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:RouteTracker.java
示例5: getConnection
import org.apache.http.util.LangUtils; //导入依赖的package包/类
synchronized HttpClientConnection getConnection(final HttpRoute route, final Object state) {
Asserts.check(!this.isShutdown.get(), "Connection manager has been shut down");
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Get connection for route " + route);
}
Asserts.check(!this.leased, "Connection is still allocated");
if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state, state)) {
closeConnection();
}
this.route = route;
this.state = state;
checkExpiry();
if (this.conn == null) {
this.conn = this.connFactory.create(route, this.connConfig);
}
this.leased = true;
return this.conn;
}
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:19,代码来源:BasicHttpClientConnectionManager.java
示例6: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* @see java.lang.Object#equals(Object)
*/
@Override
public boolean equals(final Object o) {
if (o == null) {
return false;
}
if (o == this) {
return true;
}
if (!(o instanceof AuthScope)) {
return super.equals(o);
}
final AuthScope that = (AuthScope) o;
return
LangUtils.equals(this.host, that.host)
&& this.port == that.port
&& LangUtils.equals(this.realm, that.realm)
&& LangUtils.equals(this.scheme, that.scheme);
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:22,代码来源:AuthScope.java
示例7: getConnection
import org.apache.http.util.LangUtils; //导入依赖的package包/类
synchronized HttpClientConnection getConnection(final HttpRoute route, final Object state) {
Asserts.check(!this.isShutdown.get(), "Connection manager has been shut down");
if (this.log.isDebugEnabled()) {
this.log.debug("Get connection for route " + route);
}
Asserts.check(!this.leased, "Connection is still allocated");
if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state, state)) {
closeConnection();
}
this.route = route;
this.state = state;
checkExpiry();
if (this.conn == null) {
this.conn = this.connFactory.create(route, this.connConfig);
}
this.leased = true;
return this.conn;
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:19,代码来源:BasicHttpClientConnectionManager.java
示例8: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Compares this route to another.
*
* @param obj the object to compare with
*
* @return {@code true} if the argument is the same route,
* {@code false}
*/
@Override
public final boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof HttpRoute) {
final HttpRoute that = (HttpRoute) obj;
return
// Do the cheapest tests first
(this.secure == that.secure) &&
(this.tunnelled == that.tunnelled) &&
(this.layered == that.layered) &&
LangUtils.equals(this.targetHost, that.targetHost) &&
LangUtils.equals(this.localAddress, that.localAddress) &&
LangUtils.equals(this.proxyChain, that.proxyChain);
} else {
return false;
}
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:28,代码来源:HttpRoute.java
示例9: hashCode
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Generates a hash code for this route.
*
* @return the hash code
*/
@Override
public final int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.targetHost);
hash = LangUtils.hashCode(hash, this.localAddress);
if (this.proxyChain != null) {
for (final HttpHost element : this.proxyChain) {
hash = LangUtils.hashCode(hash, element);
}
}
hash = LangUtils.hashCode(hash, this.secure);
hash = LangUtils.hashCode(hash, this.tunnelled);
hash = LangUtils.hashCode(hash, this.layered);
return hash;
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:21,代码来源:HttpRoute.java
示例10: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Compares this tracked route to another.
*
* @param o the object to compare with
*
* @return {@code true} if the argument is the same tracked route,
* {@code false}
*/
@Override
public final boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof RouteTracker)) {
return false;
}
final RouteTracker that = (RouteTracker) o;
return
// Do the cheapest checks first
(this.connected == that.connected) &&
(this.secure == that.secure) &&
(this.tunnelled == that.tunnelled) &&
(this.layered == that.layered) &&
LangUtils.equals(this.targetHost, that.targetHost) &&
LangUtils.equals(this.localAddress, that.localAddress) &&
LangUtils.equals(this.proxyChain, that.proxyChain);
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:29,代码来源:RouteTracker.java
示例11: hashCode
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Generates a hash code for this tracked route.
* Route trackers are modifiable and should therefore not be used
* as lookup keys. Use {@link #toRoute toRoute} to obtain an
* unmodifiable representation of the tracked route.
*
* @return the hash code
*/
@Override
public final int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.targetHost);
hash = LangUtils.hashCode(hash, this.localAddress);
if (this.proxyChain != null) {
for (final HttpHost element : this.proxyChain) {
hash = LangUtils.hashCode(hash, element);
}
}
hash = LangUtils.hashCode(hash, this.connected);
hash = LangUtils.hashCode(hash, this.secure);
hash = LangUtils.hashCode(hash, this.tunnelled);
hash = LangUtils.hashCode(hash, this.layered);
return hash;
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:25,代码来源:RouteTracker.java
示例12: testCloneBasicRequests
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Test
public void testCloneBasicRequests() throws Exception {
final HttpGet httpget = new HttpGet("http://host/path");
httpget.addHeader("h1", "this header");
httpget.addHeader("h2", "that header");
httpget.addHeader("h3", "all sorts of headers");
final HttpGet clone = (HttpGet) httpget.clone();
Assert.assertEquals(httpget.getMethod(), clone.getMethod());
Assert.assertEquals(httpget.getURI(), clone.getURI());
final Header[] headers1 = httpget.getAllHeaders();
final Header[] headers2 = clone.getAllHeaders();
Assert.assertTrue(LangUtils.equals(headers1, headers2));
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:17,代码来源:TestHttpRequestBase.java
示例13: testCloneEntityEnclosingRequests
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Test
public void testCloneEntityEnclosingRequests() throws Exception {
final HttpPost httppost = new HttpPost("http://host/path");
httppost.addHeader("h1", "this header");
httppost.addHeader("h2", "that header");
httppost.addHeader("h3", "all sorts of headers");
HttpPost clone = (HttpPost) httppost.clone();
Assert.assertEquals(httppost.getMethod(), clone.getMethod());
Assert.assertEquals(httppost.getURI(), clone.getURI());
final Header[] headers1 = httppost.getAllHeaders();
final Header[] headers2 = clone.getAllHeaders();
Assert.assertTrue(LangUtils.equals(headers1, headers2));
Assert.assertNull(clone.getEntity());
final StringEntity e1 = new StringEntity("stuff");
httppost.setEntity(e1);
clone = (HttpPost) httppost.clone();
Assert.assertTrue(clone.getEntity() instanceof StringEntity);
Assert.assertFalse(clone.getEntity().equals(e1));
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:25,代码来源:TestHttpRequestBase.java
示例14: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* @see java.lang.Object#equals(Object)
*/
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (o == this) {
return true;
}
if (!(o instanceof AuthScope)) {
return super.equals(o);
}
AuthScope that = (AuthScope) o;
return
LangUtils.equals(this.host, that.host)
&& this.port == that.port
&& LangUtils.equals(this.realm, that.realm)
&& LangUtils.equals(this.scheme, that.scheme);
}
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:22,代码来源:AuthScope.java
示例15: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof BasicUserPrincipal) {
BasicUserPrincipal that = (BasicUserPrincipal) o;
if (LangUtils.equals(this.username, that.username)) {
return true;
}
}
return false;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:BasicUserPrincipal.java
示例16: hashCode
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Override
public int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.principal);
hash = LangUtils.hashCode(hash, this.workstation);
return hash;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:NTCredentials.java
示例17: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof NTCredentials) {
NTCredentials that = (NTCredentials) o;
if (LangUtils.equals(this.principal, that.principal)
&& LangUtils.equals(this.workstation, that.workstation)) {
return true;
}
}
return false;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:NTCredentials.java
示例18: hashCode
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Override
public int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.username);
hash = LangUtils.hashCode(hash, this.domain);
return hash;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:NTUserPrincipal.java
示例19: equals
import org.apache.http.util.LangUtils; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof NTUserPrincipal) {
NTUserPrincipal that = (NTUserPrincipal) o;
if (LangUtils.equals(this.username, that.username)
&& LangUtils.equals(this.domain, that.domain)) {
return true;
}
}
return false;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:NTUserPrincipal.java
示例20: match
import org.apache.http.util.LangUtils; //导入依赖的package包/类
/**
* Tests if the authentication scopes match.
*
* @return the match factor. Negative value signifies no match.
* Non-negative signifies a match. The greater the returned value
* the closer the match.
*/
public int match(final AuthScope that) {
int factor = 0;
if (LangUtils.equals(this.scheme, that.scheme)) {
factor += 1;
} else {
if (this.scheme != ANY_SCHEME && that.scheme != ANY_SCHEME) {
return -1;
}
}
if (LangUtils.equals(this.realm, that.realm)) {
factor += 2;
} else {
if (this.realm != ANY_REALM && that.realm != ANY_REALM) {
return -1;
}
}
if (this.port == that.port) {
factor += 4;
} else {
if (this.port != ANY_PORT && that.port != ANY_PORT) {
return -1;
}
}
if (LangUtils.equals(this.host, that.host)) {
factor += 8;
} else {
if (this.host != ANY_HOST && that.host != ANY_HOST) {
return -1;
}
}
return factor;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:40,代码来源:AuthScope.java
注:本文中的org.apache.http.util.LangUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论