Example usage for java.lang Object hashCode

List of usage examples for java.lang Object hashCode

Introduction

In this page you can find the example usage for java.lang Object hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:com.amazonaws.mobileconnectors.pinpoint.internal.core.util.JSONBuilder.java

public JSONBuilder(Object component) {
    if (null != component) {
        this.withAttribute("class", component.getClass().getName());
        this.withAttribute("hashCode", Integer.toHexString(component.hashCode()));
    }//from   w  ww.  j a  v a2 s  .  co  m
}

From source file:ch.cyberduck.core.NSObjectPathReference.java

@Override
public boolean equals(final Object other) {
    if (null == other) {
        return false;
    }/*  ww w.ja va2s .c o  m*/
    if (other instanceof CacheReference) {
        return this.hashCode() == other.hashCode();
    }
    return false;
}

From source file:com.marvinformatics.hibernate.json.JsonUserType.java

@Override
public int hashCode(Object x) throws HibernateException {
    return null == x ? 0 : x.hashCode();
}

From source file:org.globus.axis.transport.commons.ExtendedHostConfiguration.java

public int hashCode() {
    int hash = super.hashCode();
    if (this.paramList == null) {
        return hash;
    } else {/*from   ww w . j  a va  2  s . com*/
        for (int i = 0; i < this.paramList.length; i++) {
            Object value = getParameter(this.paramList[i]);
            if (value != null) {
                hash += (this.paramList[i].hashCode() ^ value.hashCode());
            }
        }
        return hash;
    }
}

From source file:cn.guoyukun.spring.jpa.repository.hibernate.type.CollectionToStringUserType.java

@Override
public int hashCode(Object o) throws HibernateException {
    return o.hashCode();
}

From source file:org.structr.schema.importer.NodeInfo.java

@Override
public boolean equals(Object other) {

    if (other instanceof NodeInfo) {

        return hashCode() == other.hashCode();
    }/*from w w  w.  j  a  v  a  2  s . c om*/

    return false;
}

From source file:com.expedia.seiso.domain.entity.ItemTests.java

private void exerciseHashCode(Object item) {
    log.trace("Exercising hashCode()");
    item.hashCode();
}

From source file:com.zenoss.zenpacks.zenjmx.call.JmxCall.java

/**
 * Returns the hashcode from the variable provided in a safe way
 *//*from www.java2  s .com*/
int hashCode(Object variable) {
    if (variable != null) {
        return variable.hashCode();
    } else {
        return 0;
    }
}

From source file:com.aliyun.odps.mapred.local.MapOutputBuffer.java

/**
 * Hard coded partition strategy. Should be the same as FUXI hash function.
 *
 * @return/*from  w  w  w  .j a va 2 s. c  om*/
 */
protected int getPartition(Record key) {
    int partition = 0;
    for (int i : partColIdxs) {
        Object o = key.get(i);
        if (o != null) {
            partition = partition * 32 + o.hashCode();
        } else {
            partition = partition * 32;
        }
    }
    return Math.abs(partition) % numReduce;
}

From source file:org.springframework.orm.hibernate3.support.AbstractLobType.java

/**
 * This implementation returns the hashCode of the given objectz.
 *///from   w w w . j a  va2 s  . c o  m
@Override
public int hashCode(Object x) throws HibernateException {
    return x.hashCode();
}