Example usage for java.util Arrays hashCode

List of usage examples for java.util Arrays hashCode

Introduction

In this page you can find the example usage for java.util Arrays hashCode.

Prototype

public static int hashCode(Object a[]) 

Source Link

Document

Returns a hash code based on the contents of the specified array.

Usage

From source file:org.broadleafcommerce.openadmin.dto.PersistencePackage.java

@Override
public int hashCode() {
    int result = ceilingEntityFullyQualifiedClassname != null ? ceilingEntityFullyQualifiedClassname.hashCode()
            : 0;//from  www .  jav  a2 s  .c om
    result = 31 * result + (sectionEntityField != null ? sectionEntityField.hashCode() : 0);
    result = 31 * result
            + (fetchTypeFullyQualifiedClassname != null ? fetchTypeFullyQualifiedClassname.hashCode() : 0);
    result = 31 * result + (persistencePerspective != null ? persistencePerspective.hashCode() : 0);
    result = 31 * result + (customCriteria != null ? Arrays.hashCode(customCriteria) : 0);
    result = 31 * result + (entity != null ? entity.hashCode() : 0);
    result = 31 * result + (csrfToken != null ? csrfToken.hashCode() : 0);
    return result;
}

From source file:org.apache.flink.api.java.typeutils.PojoTypeInfo.java

@Override
public int hashCode() {
    return 31 * (31 * Arrays.hashCode(fields) + totalFields) + super.hashCode();
}

From source file:uk.ac.ucl.excites.sapelli.shared.io.text.UnicodeBOM.java

@Override
public int hashCode() {
    int hash = 1;
    hash = 31 * hash + (charset == null ? 0 : charset.hashCode());
    hash = 31 * hash + Arrays.hashCode(bytes);
    return hash;//  w  w w . j  ava2s  .c  o  m
}

From source file:org.broadleafcommerce.openadmin.dto.PersistencePerspective.java

@Override
public int hashCode() {
    int result = additionalNonPersistentProperties != null ? Arrays.hashCode(additionalNonPersistentProperties)
            : 0;/*from  w w  w  .j av a2  s. c  o m*/
    result = 31 * result + (additionalForeignKeys != null ? Arrays.hashCode(additionalForeignKeys) : 0);
    result = 31 * result + (persistencePerspectiveItems != null ? persistencePerspectiveItems.hashCode() : 0);
    result = 31 * result + (operationTypes != null ? operationTypes.hashCode() : 0);
    result = 31 * result + (populateToOneFields != null ? populateToOneFields.hashCode() : 0);
    result = 31 * result + (excludeFields != null ? Arrays.hashCode(excludeFields) : 0);
    result = 31 * result + (includeFields != null ? Arrays.hashCode(includeFields) : 0);
    result = 31 * result + (configurationKey != null ? configurationKey.hashCode() : 0);
    result = 31 * result + (showArchivedFields != null ? showArchivedFields.hashCode() : 0);
    result = 31 * result + (useServerSideInspectionCache != null ? useServerSideInspectionCache.hashCode() : 0);
    return result;
}

From source file:io.onedecision.engine.decisions.model.dmn.DmnModel.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((created == null) ? 0 : created.hashCode());
    result = prime * result + ((definitionId == null) ? 0 : definitionId.hashCode());
    result = prime * result + ((definitionXml == null) ? 0 : definitionXml.hashCode());
    result = prime * result + ((deploymentMessage == null) ? 0 : deploymentMessage.hashCode());
    result = prime * result + ((shortId == null) ? 0 : shortId.hashCode());
    result = prime * result + Arrays.hashCode(image);
    result = prime * result + ((lastUpdated == null) ? 0 : lastUpdated.hashCode());
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    result = prime * result + ((originalFileName == null) ? 0 : originalFileName.hashCode());
    result = prime * result + ((tenantId == null) ? 0 : tenantId.hashCode());
    return result;
}

From source file:org.apache.ambari.server.orm.entities.HostRoleCommandEntity.java

@Override
public int hashCode() {
    int result = taskId != null ? taskId.hashCode() : 0;
    result = 31 * result + (requestId != null ? requestId.hashCode() : 0);
    result = 31 * result + (stageId != null ? stageId.hashCode() : 0);
    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
    result = 31 * result + (role != null ? role.hashCode() : 0);
    result = 31 * result + (event != null ? event.hashCode() : 0);
    result = 31 * result + (exitcode != null ? exitcode.hashCode() : 0);
    result = 31 * result + (status != null ? status.hashCode() : 0);
    result = 31 * result + (stdError != null ? Arrays.hashCode(stdError) : 0);
    result = 31 * result + (stdOut != null ? Arrays.hashCode(stdOut) : 0);
    result = 31 * result + (outputLog != null ? outputLog.hashCode() : 0);
    result = 31 * result + (errorLog != null ? errorLog.hashCode() : 0);
    result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
    result = 31 * result + (lastAttemptTime != null ? lastAttemptTime.hashCode() : 0);
    result = 31 * result + (attemptCount != null ? attemptCount.hashCode() : 0);
    result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
    result = 31 * result + (structuredOut != null ? Arrays.hashCode(structuredOut) : 0);
    return result;
}

From source file:ch.cyberduck.core.cdn.Distribution.java

@Override
public int hashCode() {
    int result = (deployed ? 1 : 0);
    result = 31 * result + (enabled ? 1 : 0);
    result = 31 * result + (logging ? 1 : 0);
    result = 31 * result + (loggingContainer != null ? loggingContainer.hashCode() : 0);
    result = 31 * result + (cnames != null ? Arrays.hashCode(cnames) : 0);
    result = 31 * result + (method != null ? method.hashCode() : 0);
    result = 31 * result + (indexDocument != null ? indexDocument.hashCode() : 0);
    result = 31 * result + (errorDocument != null ? errorDocument.hashCode() : 0);
    return result;
}

From source file:de.bfs.radon.omsimulation.data.OMSimulation.java

/**
 * @see java.lang.Object#hashCode()//from  w  w w .  ja v  a2  s  . c o  m
 */
@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + Arrays.hashCode(this.campaigns);
    result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
    result = prime * result + this.count;
    return result;
}

From source file:it.unimi.dsi.util.Properties.java

public int hashCode() {
    int h = 0;//  ww w .ja  v a  2s  .  c o  m
    for (Iterator<?> i = getKeys(); i.hasNext();)
        h = h * 31 + Arrays.hashCode(getStringArray((String) i.next()));
    return h;
}

From source file:org.opendaylight.controller.cluster.messaging.MessageSlicingIntegrationTest.java

@SuppressWarnings("unchecked")
private void testSlicing(final String logContext, final int messageSliceSize, final int expTotalSlices,
        final byte[] messageData) {
    reset(mockAssembledMessageCallback);

    final BytesMessage message = new BytesMessage(messageData);

    try (MessageSlicer slicer = newMessageSlicer(logContext, messageSliceSize)) {
        final boolean wasSliced = slice(slicer, IDENTIFIER, message, sendToProbe.ref(), replyToProbe.ref(),
                mockOnFailureCallback);/*from   w  ww . j a va2 s  . c  om*/
        assertTrue(wasSliced);

        Identifier slicingId = null;
        int expLastSliceHashCode = SlicedMessageState.INITIAL_SLICE_HASH_CODE;
        for (int sliceIndex = 1; sliceIndex <= expTotalSlices; sliceIndex++) {
            final MessageSlice sliceMessage = sendToProbe.expectMsgClass(MessageSlice.class);
            slicingId = sliceMessage.getIdentifier();
            assertMessageSlice(sliceMessage, IDENTIFIER, sliceIndex, expTotalSlices, expLastSliceHashCode,
                    replyToProbe.ref());

            assembler.handleMessage(sliceMessage, sendToProbe.ref());

            final MessageSliceReply reply = replyToProbe.expectMsgClass(MessageSliceReply.class);
            assertSuccessfulMessageSliceReply(reply, IDENTIFIER, sliceIndex);

            expLastSliceHashCode = Arrays.hashCode(sliceMessage.getData());

            slicer.handleMessage(reply);
        }

        assertAssembledMessage(message, replyToProbe.ref());

        assertFalse("MessageSlicer did not remove state for " + slicingId, slicer.hasState(slicingId));
        assertFalse("MessageAssembler did not remove state for " + slicingId, assembler.hasState(slicingId));
    }
}