Java Code Examples for org.apache.commons.lang.builder.HashCodeBuilder

The following examples show how to use org.apache.commons.lang.builder.HashCodeBuilder. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: incubator-sentry   Source File: TPrivilegeChanges.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_authzObj = true && (isSetAuthzObj());
  builder.append(present_authzObj);
  if (present_authzObj)
    builder.append(authzObj);

  boolean present_addPrivileges = true && (isSetAddPrivileges());
  builder.append(present_addPrivileges);
  if (present_addPrivileges)
    builder.append(addPrivileges);

  boolean present_delPrivileges = true && (isSetDelPrivileges());
  builder.append(present_delPrivileges);
  if (present_delPrivileges)
    builder.append(delPrivileges);

  return builder.toHashCode();
}
 
Example 2
Source Project: gitlab-plugin   Source File: Project.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
            .append(id)
            .append(name)
            .append(description)
            .append(webUrl)
            .append(avatarUrl)
            .append(namespace)
            .append(visibilityLevel)
            .append(pathWithNamespace)
            .append(defaultBranch)
            .append(homepage)
            .append(url)
            .append(sshUrl)
            .append(httpUrl)
            .toHashCode();
}
 
Example 3
Source Project: incubator-sentry   Source File: TSentryMappingData.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_groupRolesMap = true && (isSetGroupRolesMap());
  builder.append(present_groupRolesMap);
  if (present_groupRolesMap)
    builder.append(groupRolesMap);

  boolean present_rolePrivilegesMap = true && (isSetRolePrivilegesMap());
  builder.append(present_rolePrivilegesMap);
  if (present_rolePrivilegesMap)
    builder.append(rolePrivilegesMap);

  return builder.toHashCode();
}
 
Example 4
Source Project: incubator-sentry   Source File: TSentryRole.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_roleName = true && (isSetRoleName());
  builder.append(present_roleName);
  if (present_roleName)
    builder.append(roleName);

  boolean present_groups = true && (isSetGroups());
  builder.append(present_groups);
  if (present_groups)
    builder.append(groups);

  return builder.toHashCode();
}
 
Example 5
Source Project: wallride   Source File: BlogLanguage.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
	return new HashCodeBuilder()
			.append(getId())
			.append(getLanguage())
			.toHashCode();
}
 
Example 6
Source Project: big-c   Source File: ShortCircuitShm.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder().
      append(this.shmId).
      append(this.slotIdx).
      toHashCode();
}
 
Example 7
Source Project: gemfirexd-oss   Source File: Table.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public int hashCode()
{
    // TODO: For now we ignore catalog and schema (type should be irrelevant anyways)
    return new HashCodeBuilder(17, 37).append(_name)
                                      .append(_columns)
                                      .append(new HashSet(_foreignKeys))
                                      .append(new HashSet(_indices))
                                      .toHashCode();
}
 
Example 8
@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
        .append(id)
        .append(title)
        .append(color)
        .append(projectId)
        .append(createdAt)
        .append(updatedAt)
        .append(template)
        .append(description)
        .append(type)
        .append(groupId)
        .toHashCode();
}
 
Example 9
@Override
public int hashCode()
{
  HashCodeBuilder hcb = new HashCodeBuilder();
  hcb.append(this.taskId);
  hcb.append(this.kost2Id);
  hcb.append(this.location);
  hcb.append(this.description);
  return hcb.toHashCode();
}
 
Example 10
Source Project: openregistry   Source File: JpaIdentifierImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
   public int hashCode()
   {
      return new HashCodeBuilder()
         .append(this.value)
                 .append(this.type)
//         .append(this.type!=null?this.type.getName():"NULL")
         .toHashCode();
   }
 
Example 11
Source Project: hadoop   Source File: ElasticByteBufferPool.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder().
      append(capacity).
      append(insertionTime).
      toHashCode();
}
 
Example 12
Source Project: idea-gitignore   Source File: IgnoreEntryOccurrence.java    License: MIT License 5 votes vote down vote up
/**
 * Calculates hashCode with {@link #url} and {@link #items} hashCodes.
 *
 * @return entry hashCode
 */
@Override
public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder().append(url);

    for (Pair<String, Boolean> item : items) {
        builder.append(item.first).append(item.second);
    }

    return builder.toHashCode();
}
 
Example 13
Source Project: idea-gitignore   Source File: MatcherUtil.java    License: MIT License 5 votes vote down vote up
/**
 * Extracts alphanumeric parts from the regex pattern and checks if any of them is contained in the tested path.
 * Looking for the parts speed ups the matching and prevents from running whole regex on the string.
 *
 * @param pattern to explode
 * @param path    to check
 * @return path matches the pattern
 */
public boolean match(@Nullable Pattern pattern, @Nullable String path) {
    if (pattern == null || path == null) {
        return false;
    }

    synchronized (cache) {
        int hashCode = new HashCodeBuilder().append(pattern).append(path).toHashCode();

        if (!cache.containsKey(hashCode)) {
            final String[] parts = getParts(pattern);
            boolean result = false;

            if (parts.length == 0 || matchAllParts(parts, path)) {
                try {
                    result = pattern.matcher(path).find();
                } catch (StringIndexOutOfBoundsException ignored) {
                }
            }

            cache.put(hashCode, result);
            return result;
        }

        return cache.get(hashCode);
    }
}
 
Example 14
Source Project: phoenicis   Source File: TypeDTO.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
            .append(id)
            .append(name)
            .append(categories)
            .append(icon)
            .toHashCode();
}
 
Example 15
Source Project: metron   Source File: SensorParserConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder(17, 37)
          .append(parserClassName)
          .append(filterClassName)
          .append(sensorTopic)
          .append(outputTopic)
          .append(errorTopic)
          .append(writerClassName)
          .append(errorWriterClassName)
          .append(getReadMetadata())
          .append(getMergeMetadata())
          .append(numWorkers)
          .append(numAckers)
          .append(spoutParallelism)
          .append(spoutNumTasks)
          .append(parserParallelism)
          .append(parserNumTasks)
          .append(errorWriterParallelism)
          .append(errorWriterNumTasks)
          .append(spoutConfig)
          .append(securityProtocol)
          .append(stormConfig)
          .append(cacheConfig)
          .append(parserConfig)
          .append(fieldTransformations)
          .append(rawMessageStrategy)
          .append(rawMessageStrategyConfig)
          .toHashCode();
}
 
Example 16
Source Project: eagle   Source File: GenericAuditEntity.java    License: Apache License 2.0 5 votes vote down vote up
public int hashCode(){
	HashCodeBuilder builder = new HashCodeBuilder();
	builder.append(getTags().get(AUDIT_COLUMN_SERVICE_NAME));
	builder.append(getTags().get(AUDIT_COLUMN_USER_ID));
	builder.append(getTags().get(AUDIT_COLUMN_OPERATION));
	builder.append(getTags().get(AUDIT_COLUMN_TIMESTAMP));
	return builder.toHashCode();
}
 
Example 17
public int hashCode() {
   HashCodeBuilder builder = new HashCodeBuilder();
   builder.append(this.link);
   builder.append(this.proofs);
   builder.append(this.author);
   builder.append(this.requestDate);
   builder.append(this.externalId);
   return builder.toHashCode();
}
 
Example 18
Source Project: intellij-latte   Source File: LatteFunctionSettings.java    License: MIT License 5 votes vote down vote up
@Override
public int hashCode() {
	return new HashCodeBuilder()
			.append(this.functionName)
			.append(this.functionReturnType)
			.append(this.functionHelp)
			.append(this.functionDescription)
			.toHashCode();
}
 
Example 19
Source Project: cosmic   Source File: BaseNiciraEntity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder(17, 31)
            .append(this.getClass())
            .append(uuid)
            .toHashCode();
}
 
Example 20
Source Project: olat   Source File: Text.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder(1239, 5475);
    builder.append(this.getCourseId());
    builder.append(this.getType());
    builder.append(this.getLineSeq());
    builder.append(this.getLine());
    return builder.toHashCode();
}
 
Example 21
Source Project: projectforge-webapp   Source File: TaskNode.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public int hashCode()
{
  final HashCodeBuilder hcb = new HashCodeBuilder();
  hcb.append(this.getParentId()).append(this.getTask().getTitle());
  return hcb.toHashCode();
}
 
Example 22
Source Project: attic-aurora   Source File: StateMachine.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder()
      .append(from)
      .append(to)
      .toHashCode();
}
 
Example 23
Source Project: CAS   Source File: CustomCredential.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder()
            .appendSuper(super.hashCode())
            .append(this.email)
            .append(this.telephone)
            .toHashCode();
}
 
Example 24
@Override
public int hashCode() {
	return new HashCodeBuilder(57, 55)
		.append(diffType)
		.append(beforePositionRange)
		.append(afterPositionRange)
		.toHashCode();
}
 
Example 25
Source Project: HeadsUp   Source File: DashboardCategory.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
    return new HashCodeBuilder(153, 11)
            .append(id)
            .append(titleRes)
            .append(title)
            .append(tiles)
            .toHashCode();
}
 
Example 26
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_protocol_version = true;
  builder.append(present_protocol_version);
  if (present_protocol_version)
    builder.append(protocol_version);

  boolean present_component = true && (isSetComponent());
  builder.append(present_component);
  if (present_component)
    builder.append(component);

  boolean present_serviceName = true && (isSetServiceName());
  builder.append(present_serviceName);
  if (present_serviceName)
    builder.append(serviceName);

  boolean present_groups = true && (isSetGroups());
  builder.append(present_groups);
  if (present_groups)
    builder.append(groups);

  boolean present_roleSet = true && (isSetRoleSet());
  builder.append(present_roleSet);
  if (present_roleSet)
    builder.append(roleSet);

  boolean present_authorizables = true && (isSetAuthorizables());
  builder.append(present_authorizables);
  if (present_authorizables)
    builder.append(authorizables);

  return builder.toHashCode();
}
 
Example 27
Source Project: Eagle   Source File: AlertDefinitionAPIEntity.java    License: Apache License 2.0 5 votes vote down vote up
public int hashCode(){
	HashCodeBuilder builder = new HashCodeBuilder();
	builder.append(enabled);
	builder.append(policyDef);
	builder.append(dedupeDef);
	builder.append(notificationDef);
	builder.append(remediationDef);
	return builder.toHashCode();
}
 
Example 28
@Override
public int hashCode() {
    return new HashCodeBuilder().toHashCode();
}
 
Example 29
Source Project: wallride   Source File: DomainObject.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int hashCode() {
	return new HashCodeBuilder().append(getId()).toHashCode();
}
 
Example 30
Source Project: usergrid   Source File: CacheScope.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int hashCode(){
    return new HashCodeBuilder()
        .append(appId)
        .toHashCode();
}