Example usage for org.apache.commons.lang ObjectUtils hashCode

List of usage examples for org.apache.commons.lang ObjectUtils hashCode

Introduction

In this page you can find the example usage for org.apache.commons.lang ObjectUtils hashCode.

Prototype

public static int hashCode(Object obj) 

Source Link

Document

Gets the hash code of an object returning zero when the object is null.

 ObjectUtils.hashCode(null)   = 0 ObjectUtils.hashCode(obj)    = obj.hashCode() 

Usage

From source file:org.gradle.platform.base.internal.DefaultLibraryBinaryDependencySpec.java

@Override
public int hashCode() {
    int result = ObjectUtils.hashCode(projectPath);
    result = 31 * result + ObjectUtils.hashCode(libraryName);
    result = 31 * result + ObjectUtils.hashCode(variant);
    return result;
}

From source file:org.gradle.platform.base.internal.DefaultModuleDependencySpec.java

@Override
public int hashCode() {
    int result = ObjectUtils.hashCode(group);
    result = 31 * result + ObjectUtils.hashCode(name);
    result = 31 * result + ObjectUtils.hashCode(version);
    return result;
}

From source file:org.gradle.platform.base.internal.DefaultProjectDependencySpec.java

@Override
public int hashCode() {
    int result = ObjectUtils.hashCode(projectPath);
    result = 31 * result + ObjectUtils.hashCode(libraryName);
    return result;
}

From source file:org.jdto.impl.DTOCacheKey.java

@Override
public int hashCode() {

    int mdhc = ObjectUtils.hashCode(metadata);
    int ahc = ArrayUtils.hashCode(array);

    return mdhc + ahc;
}

From source file:org.kuali.kra.hierarchyrouting.UnitStop.java

public int hashCode() {
    return ObjectUtils.hashCode(id);
}

From source file:org.kuali.kra.proposaldevelopment.web.bean.ProposalUserRoles.java

@Override
public int hashCode() {
    int hash = 7;
    hash = 31 * hash + ObjectUtils.hashCode(fullname);
    hash = 31 * hash + ObjectUtils.hashCode(unitName);
    hash = 31 * hash + ObjectUtils.hashCode(unitNumber);
    hash = 31 * hash + ObjectUtils.hashCode(username);
    for (String roleName : roleNames) {
        hash = 31 * hash + ObjectUtils.hashCode(roleName);
    }/*from w ww .  j  av  a 2 s .  c om*/
    return hash;
}

From source file:org.marketcetera.client.ClientParameters.java

@Override
public int hashCode() {
    return ObjectUtils.hashCode(mUsername) + Arrays.hashCode(mPassword) + ObjectUtils.hashCode(mHostname)
            + ObjectUtils.hashCode(mPort) + ObjectUtils.hashCode(mHeartbeatInterval)
            + ObjectUtils.hashCode(mIDPrefix) + ObjectUtils.hashCode(mURL);
}

From source file:org.marketcetera.ors.Principals.java

@Override
public int hashCode() {
    return (ObjectUtils.hashCode(getActorID()) + ObjectUtils.hashCode(getViewerID()));
}

From source file:org.marketcetera.saclient.SAClientParameters.java

@Override
public int hashCode() {
    return ObjectUtils.hashCode(mUsername) + Arrays.hashCode(mPassword) + Arrays.hashCode(contextClasses)
            + ObjectUtils.hashCode(mHostname) + ObjectUtils.hashCode(mPort) + ObjectUtils.hashCode(mURL);
}

From source file:org.marketcetera.util.except.ExceptUtils.java

/**
 * Returns the hash code of the given throwable. The result
 * matches the equality definition of {@link
 * #areEqual(Throwable,Object)}./*  ww  w  . j  av a2 s . c om*/
 *
 * @param t The throwable.
 *
 * @return The hash code.
 */

public static int getHashCode(Throwable t) {
    if (t == null) {
        return 0;
    }
    int code = ObjectUtils.hashCode(t.getClass());
    if (t instanceof I18NThrowable) {
        code += ObjectUtils.hashCode(((I18NThrowable) t).getI18NBoundMessage());
    } else {
        code += ObjectUtils.hashCode(t.getMessage());
    }
    code += getHashCode(t.getCause());
    return code;
}