Java 类org.apache.commons.httpclient.util.LangUtils 实例源码

项目:lib-commons-httpclient    文件:HostConfiguration.java   
/**
 * @see java.lang.Object#equals(java.lang.Object)
 */
public synchronized boolean equals(final Object o) {
    if (o instanceof HostConfiguration) {
        // shortcut if we're comparing with ourselves
        if (o == this) { 
            return true;
        }
        HostConfiguration that = (HostConfiguration) o;
        return LangUtils.equals(this.host, that.host)
            && LangUtils.equals(this.proxyHost, that.proxyHost)
            && LangUtils.equals(this.localAddress, that.localAddress);
    } else {
        return false;
    }

}
项目:lib-commons-httpclient    文件:UsernamePasswordCredentials.java   
/**
 * These credentials are assumed equal if the username and password are the
 * same.
 *
 * @param o The other object to compare with.
 *
 * @return  <code>true</code> if the object is equivalent.
 */
public boolean equals(Object o) {
    if (o == null) return false;
    if (this == o) return true;
    // note - to allow for sub-classing, this checks that class is the same
    // rather than do "instanceof".
    if (this.getClass().equals(o.getClass())) {
        UsernamePasswordCredentials that = (UsernamePasswordCredentials) o;

        if (LangUtils.equals(this.userName, that.userName)
                && LangUtils.equals(this.password, that.password) ) {
            return true;
        }
    }
    return false;
}
项目:httpclient3-ntml    文件:HostConfiguration.java   
/**
 * @see java.lang.Object#equals(java.lang.Object)
 */
public synchronized boolean equals(final Object o) {
    if (o instanceof HostConfiguration) {
        // shortcut if we're comparing with ourselves
        if (o == this) { 
            return true;
        }
        HostConfiguration that = (HostConfiguration) o;
        return LangUtils.equals(this.host, that.host)
            && LangUtils.equals(this.proxyHost, that.proxyHost)
            && LangUtils.equals(this.localAddress, that.localAddress);
    } else {
        return false;
    }

}
项目:httpclient3-ntml    文件:UsernamePasswordCredentials.java   
/**
 * These credentials are assumed equal if the username and password are the
 * same.
 *
 * @param o The other object to compare with.
 *
 * @return  <code>true</code> if the object is equivalent.
 */
public boolean equals(Object o) {
    if (o == null) return false;
    if (this == o) return true;
    // note - to allow for sub-classing, this checks that class is the same
    // rather than do "instanceof".
    if (this.getClass().equals(o.getClass())) {
        UsernamePasswordCredentials that = (UsernamePasswordCredentials) o;

        if (LangUtils.equals(this.userName, that.userName)
                && LangUtils.equals(this.password, that.password) ) {
            return true;
        }
    }
    return false;
}
项目:lib-commons-httpclient    文件:Cookie.java   
/**
 * Returns a hash code in keeping with the
 * {@link Object#hashCode} general hashCode contract.
 * @return A hash code
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.getName());
    hash = LangUtils.hashCode(hash, this.cookieDomain);
    hash = LangUtils.hashCode(hash, this.cookiePath);
    return hash;
}
项目:lib-commons-httpclient    文件:Cookie.java   
/**
 * Two cookies are equal if the name, path and domain match.
 * @param obj The object to compare against.
 * @return true if the two objects are equal.
 */
public boolean equals(Object obj) {
    if (obj == null) return false;
    if (this == obj) return true;
    if (obj instanceof Cookie) {
        Cookie that = (Cookie) obj;
        return LangUtils.equals(this.getName(), that.getName())
              && LangUtils.equals(this.cookieDomain, that.cookieDomain)
              && LangUtils.equals(this.cookiePath, that.cookiePath);
    } else {
        return false;
    }
}
项目:lib-commons-httpclient    文件:Protocol.java   
/**
 * Return a hash code for this object
 * @return The hash code.
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.defaultPort);
    hash = LangUtils.hashCode(hash, this.scheme.toLowerCase());
    hash = LangUtils.hashCode(hash, this.secure);
    hash = LangUtils.hashCode(hash, this.socketFactory);
    return hash;
}
项目:lib-commons-httpclient    文件:NTCredentials.java   
/**
 * Computes a hash code based on all the case-sensitive parts of the credentials object.
 *
 * @return  The hash code for the credentials.
 */
public int hashCode() {
    int hash = super.hashCode();
    hash = LangUtils.hashCode(hash, this.host);
    hash = LangUtils.hashCode(hash, this.domain);
    return hash;
}
项目:lib-commons-httpclient    文件:NTCredentials.java   
/**
 * Performs a case-sensitive check to see if the components of the credentials
 * are the same.
 *
 * @param o  The object to match.
 *
 * @return <code>true</code> if all of the credentials match.
 */
public boolean equals(Object o) {
    if (o == null) return false;
    if (this == o) return true;
    if (super.equals(o) ) {
        if (o instanceof NTCredentials) {
            NTCredentials that = (NTCredentials) o;

            return LangUtils.equals(this.domain, that.domain)
                && LangUtils.equals(this.host, that.host);
        }
    }

    return false;
}
项目:lib-commons-httpclient    文件:HostConfiguration.java   
/**
 * @see java.lang.Object#hashCode()
 */
public synchronized int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.host);
    hash = LangUtils.hashCode(hash, this.proxyHost);
    hash = LangUtils.hashCode(hash, this.localAddress);
    return hash;
}
项目:lib-commons-httpclient    文件:AuthScope.java   
/**
 * @see java.lang.Object#hashCode()
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.host);
    hash = LangUtils.hashCode(hash, this.port);
    hash = LangUtils.hashCode(hash, this.realm);
    hash = LangUtils.hashCode(hash, this.scheme);
    return hash;
}
项目:lib-commons-httpclient    文件:HttpHost.java   
/**
 * @see java.lang.Object#hashCode()
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.hostname);
    hash = LangUtils.hashCode(hash, this.port);
    hash = LangUtils.hashCode(hash, this.protocol);
    return hash;
}
项目:lib-commons-httpclient    文件:NameValuePair.java   
public boolean equals(final Object object) {
    if (object == null) return false;
    if (this == object) return true;
    if (object instanceof NameValuePair) {
        NameValuePair that = (NameValuePair) object;
        return LangUtils.equals(this.name, that.name)
              && LangUtils.equals(this.value, that.value);
    } else {
        return false;
    }
}
项目:lib-commons-httpclient    文件:UsernamePasswordCredentials.java   
/**
 * Does a hash of both user name and password.
 *
 * @return The hash code including user name and password.
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.userName);
    hash = LangUtils.hashCode(hash, this.password);
    return hash;
}
项目:picframe    文件:BearerCredentials.java   
/**
 * These credentials are assumed equal if accessToken is the same.
 *
 * @param   o   The other object to compare with.
 *
 * @return      'True' if the object is equivalent.
 */
public boolean equals(Object o) {
    if (o == null) return false;
    if (this == o) return true;
    if (this.getClass().equals(o.getClass())) {
        BearerCredentials that = (BearerCredentials) o;
        if (LangUtils.equals(mAccessToken, that.mAccessToken)) {
            return true;
        }
    }
    return false;
}
项目:httpclient3-ntml    文件:Cookie.java   
/**
 * Returns a hash code in keeping with the
 * {@link Object#hashCode} general hashCode contract.
 * @return A hash code
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.getName());
    hash = LangUtils.hashCode(hash, this.cookieDomain);
    hash = LangUtils.hashCode(hash, this.cookiePath);
    return hash;
}
项目:httpclient3-ntml    文件:Cookie.java   
/**
 * Two cookies are equal if the name, path and domain match.
 * @param obj The object to compare against.
 * @return true if the two objects are equal.
 */
public boolean equals(Object obj) {
    if (obj == null) return false;
    if (this == obj) return true;
    if (obj instanceof Cookie) {
        Cookie that = (Cookie) obj;
        return LangUtils.equals(this.getName(), that.getName())
              && LangUtils.equals(this.cookieDomain, that.cookieDomain)
              && LangUtils.equals(this.cookiePath, that.cookiePath);
    } else {
        return false;
    }
}
项目:httpclient3-ntml    文件:Protocol.java   
/**
 * Return a hash code for this object
 * @return The hash code.
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.defaultPort);
    hash = LangUtils.hashCode(hash, this.scheme.toLowerCase());
    hash = LangUtils.hashCode(hash, this.secure);
    hash = LangUtils.hashCode(hash, this.socketFactory);
    return hash;
}
项目:httpclient3-ntml    文件:NTCredentials.java   
/**
 * Computes a hash code based on all the case-sensitive parts of the credentials object.
 *
 * @return  The hash code for the credentials.
 */
public int hashCode() {
    int hash = super.hashCode();
    hash = LangUtils.hashCode(hash, this.host);
    hash = LangUtils.hashCode(hash, this.domain);
    return hash;
}
项目:httpclient3-ntml    文件:NTCredentials.java   
/**
 * Performs a case-sensitive check to see if the components of the credentials
 * are the same.
 *
 * @param o  The object to match.
 *
 * @return <code>true</code> if all of the credentials match.
 */
public boolean equals(Object o) {
    if (o == null) return false;
    if (this == o) return true;
    if (super.equals(o) ) {
        if (o instanceof NTCredentials) {
            NTCredentials that = (NTCredentials) o;

            return LangUtils.equals(this.domain, that.domain)
                && LangUtils.equals(this.host, that.host);
        }
    }

    return false;
}
项目:httpclient3-ntml    文件:HostConfiguration.java   
/**
 * @see java.lang.Object#hashCode()
 */
public synchronized int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.host);
    hash = LangUtils.hashCode(hash, this.proxyHost);
    hash = LangUtils.hashCode(hash, this.localAddress);
    return hash;
}
项目:httpclient3-ntml    文件:AuthScope.java   
/**
 * @see java.lang.Object#hashCode()
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.host);
    hash = LangUtils.hashCode(hash, this.port);
    hash = LangUtils.hashCode(hash, this.realm);
    hash = LangUtils.hashCode(hash, this.scheme);
    return hash;
}
项目:httpclient3-ntml    文件:HttpHost.java   
/**
 * @see java.lang.Object#hashCode()
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.hostname);
    hash = LangUtils.hashCode(hash, this.port);
    hash = LangUtils.hashCode(hash, this.protocol);
    return hash;
}
项目:httpclient3-ntml    文件:NameValuePair.java   
public boolean equals(final Object object) {
    if (object == null) return false;
    if (this == object) return true;
    if (object instanceof NameValuePair) {
        NameValuePair that = (NameValuePair) object;
        return LangUtils.equals(this.name, that.name)
              && LangUtils.equals(this.value, that.value);
    } else {
        return false;
    }
}
项目:httpclient3-ntml    文件:UsernamePasswordCredentials.java   
/**
 * Does a hash of both user name and password.
 *
 * @return The hash code including user name and password.
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.userName);
    hash = LangUtils.hashCode(hash, this.password);
    return hash;
}
项目:lib-commons-httpclient    文件:NameValuePair.java   
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.name);
    hash = LangUtils.hashCode(hash, this.value);
    return hash;
}
项目:picframe    文件:BearerCredentials.java   
/**
 * Does a hash of the access token.
 *
 * @return The hash code of the access token
 */
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, mAccessToken);
    return hash;
}
项目:httpclient3-ntml    文件:NameValuePair.java   
public int hashCode() {
    int hash = LangUtils.HASH_SEED;
    hash = LangUtils.hashCode(hash, this.name);
    hash = LangUtils.hashCode(hash, this.value);
    return hash;
}