Example usage for org.apache.commons.lang.builder HashCodeBuilder append

List of usage examples for org.apache.commons.lang.builder HashCodeBuilder append

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder HashCodeBuilder append.

Prototype

public HashCodeBuilder append(short[] array) 

Source Link

Document

Append a hashCode for a short array.

Usage

From source file:com.coroptis.coidi.op.view.entities.AbstractEntity.java

/**
 * Utility method for <code>hashCode()</code> methods.
 * //w  w w .  j a v  a2s  .c  om
 * @param values
 *            the values to use in calculation
 * @return the hash code value
 */
protected int calculateHashCode(final Object... values) {
    HashCodeBuilder builder = new HashCodeBuilder();
    for (Object value : values) {
        builder.append(value);
    }
    return builder.toHashCode();
}

From source file:eu.datex2.schema._2_0rc2._2_0.OpenlrPathAttributes.java

/**
 * Hash code.//from   w w w  .jav a2s .  c o  m
 * 
 * @param hashCodeBuilder
 *            the hash code builder
 */
public final void hashCode(final HashCodeBuilder hashCodeBuilder) {
    hashCodeBuilder.append(this.getOpenlrLowestFRCToNextLRPoint());
    hashCodeBuilder.append(this.getOpenlrDistanceToNextLRPoint());
    hashCodeBuilder.append(this.getOpenlrPathAttributesExtension());
}

From source file:eu.datex2.schema._2_0rc2._2_0.OpenlrBaseLocationReferencePoint.java

/**
 * Hash code.//  w w w  . j av a 2  s .co  m
 *
 * @param hashCodeBuilder the hash code builder
 */
public void hashCode(final HashCodeBuilder hashCodeBuilder) {
    hashCodeBuilder.append(this.getOpenlrCoordinate());
    hashCodeBuilder.append(this.getOpenlrLineAttributes());
    hashCodeBuilder.append(this.getOpenlrBaseLocationReferencePointExtension());
}

From source file:com.cloudera.crunch.type.writable.TupleWritable.java

public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();
    builder.append(written);
    for (Writable v : values) {
        builder.append(v);// w ww.j a  v a2s. c o m
    }
    return builder.toHashCode();
}

From source file:ar.com.zauber.commons.repository.BaseEntity.java

/** @see Object#hashCode() */
public final int naturalHashCode() {
    Set<Field> fields = this.getIdentityFields();
    if (fields != null && fields.size() > 0) {
        HashCodeBuilder hashCodeBuilder = new HashCodeBuilder();
        for (Field field : fields) {
            try {
                hashCodeBuilder.append(field.get(this));
            } catch (final IllegalArgumentException e) {
                throw new IllegalStateException(e);
            } catch (final IllegalAccessException e) {
                throw new IllegalStateException(e);
            }//ww  w .  jav a 2 s. c  om
        }
        return hashCodeBuilder.hashCode();
    }
    return this.hashCode();

}

From source file:eu.datex2.schema._2_0rc2._2_0.OpenlrPoiWithAccessPoint.java

/**
 * {@inheritDoc}/*from  w  w w.j ava2  s . co  m*/
 */
@Override
public final void hashCode(final HashCodeBuilder hashCodeBuilder) {
    super.hashCode(hashCodeBuilder);
    hashCodeBuilder.append(this.getOpenlrCoordinate());
    hashCodeBuilder.append(this.getOpenlrPoiWithAccessPointExtension());
}

From source file:com.ms.commons.summer.web.util.json.JsonNumberMorpher.java

public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();
    builder.append(type);
    if (isUseDefault()) {
        builder.append(getDefaultValue());
    }/*from   ww w. j  av  a  2  s .c o  m*/
    return builder.toHashCode();
}

From source file:eu.datex2.schema._2_0rc2._2_0.OpenlrLocationReferencePoint.java

/**
 * {@inheritDoc}/*w w w . j  a v  a  2  s .c  om*/
 */
@Override
public final void hashCode(final HashCodeBuilder hashCodeBuilder) {
    super.hashCode(hashCodeBuilder);
    hashCodeBuilder.append(this.getOpenlrPathAttributes());
    hashCodeBuilder.append(this.getOpenlrLocationReferencePointExtension());
}

From source file:com.sun.socialsite.pojos.AppData.java

@Override
public int hashCode() {
    HashCodeBuilder hcb = new HashCodeBuilder().append(getName());
    if (app != null)
        hcb.append(app.getId());
    hcb.append(name);// w w w. j  ava2s  .c  om
    return hcb.toHashCode();
}

From source file:com.sun.socialsite.pojos.GroupProperty.java

@Override
public int hashCode() {
    HashCodeBuilder hcb = new HashCodeBuilder().append(id);
    if (group != null)
        hcb.append(group.getId());
    else/*from  w w w. ja v  a 2  s .co  m*/
        hcb.append("null");
    return hcb.toHashCode();
}