类org.apache.commons.lang3.builder.HashCodeBuilder源码实例Demo

下面列出了怎么用org.apache.commons.lang3.builder.HashCodeBuilder的API类实例代码及写法,或者点击链接到github查看源代码。


/**
 * Constructs a new symmetric, immutable pair on the given parameters.  The
 * hashCode is determined upon construction, so the assumption is made that
 * first and second are immutable or will not be mutated. If they or any of
 * their hashable components are mutated post-construction, the hashCode will
 * be incorrect and the behavior of instances of this pair in such structures
 * as hash maps will be undefined (e.g. this pair may seem to "disappear" from
 * the hash map, even though it's still there).
 * @param first First element of this pair
 * @param second Second element of this pair
 */
public SymmetricImmutablePair(
    @NonNull final Type first,
    @NonNull final Type second) {

  if (first.compareTo(second) < 0) {
    this.first = first;
    this.second = second;
  }
  else {
    this.first = second;
    this.second = first;
  }

  this.hashCode = new HashCodeBuilder(541, 7873)
    .append(this.first)
    .append(this.second)
    .toHashCode();
}
 
源代码2 项目: uyuni   文件: SslContentSource.java

/**
 * {@inheritDoc}
 */
public int hashCode() {
    return new HashCodeBuilder().append(getCaCert())
            .append(getClientCert())
            .append(getClientKey())
            .toHashCode();
}
 
源代码3 项目: clouditor   文件: Control.java

@Override
public int hashCode() {
  return new HashCodeBuilder(17, 37)
      .append(rules)
      .append(controlId)
      .append(description)
      .append(domain)
      .append(name)
      .toHashCode();
}
 
源代码4 项目: syncope   文件: AbstractPatchItem.java

@Override
public int hashCode() {
    return new HashCodeBuilder().
            appendSuper(super.hashCode()).
            append(value).
            build();
}
 
源代码5 项目: uyuni   文件: ServerGroupStateRevision.java

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
    return new HashCodeBuilder()
            .appendSuper(super.hashCode())
            .append(getGroup())
            .toHashCode();
}
 
源代码6 项目: uyuni   文件: KickstartIpRange.java

/**
 * {@inheritDoc}
 */
public int hashCode() {
    return new HashCodeBuilder().append(ksdata)
                                .append(org)
                                .append(min)
                                .append(max)
                                .toHashCode();
}
 
源代码7 项目: sailfish-core   文件: BugDescription.java

@Override
public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();

    builder.append(categories);

    return builder.toHashCode();
}
 
源代码8 项目: hadoop-ozone   文件: ContainerState.java

@Override
public int hashCode() {
  return new HashCodeBuilder(137, 757)
      .append(owner)
      .append(pipelineID)
      .toHashCode();
}
 
源代码9 项目: syncope   文件: GoogleMfaAuthAccount.java

@Override
public int hashCode() {
    return new HashCodeBuilder()
        .appendSuper(super.hashCode())
        .append(key)
        .append(secretKey)
        .append(owner)
        .append(scratchCodes)
        .append(validationCode)
        .append(registrationDate)
        .toHashCode();
}
 
源代码10 项目: java-pilosa   文件: ValueCountResult.java

@Override
public int hashCode() {
    return new HashCodeBuilder(31, 47)
            .append(this.value)
            .append(this.count)
            .toHashCode();
}
 
源代码11 项目: uyuni   文件: OrgDto.java

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
    HashCodeBuilder b = new HashCodeBuilder();
    b.append(getId()).append(getName());
    return b.toHashCode();
}
 
源代码12 项目: development   文件: JsonObject.java

@Override
public int hashCode() {
    return new HashCodeBuilder(17, 31)
            . // two randomly chosen prime numbers
            append(locale).append(parameters).append(messageType)
            .append(responseCode).toHashCode();
}
 

@Override
public int hashCode() {
	return new HashCodeBuilder()
		.append(vertexCount)
		.append(averageLocalClusteringCoefficient)
		.hashCode();
}
 
源代码14 项目: java-pilosa   文件: CountResultItem.java

@Override
public int hashCode() {
    return new HashCodeBuilder(31, 47)
            .append(this.id)
            .append(key)
            .append(this.count)
            .toHashCode();
}
 
源代码15 项目: jstarcraft-core   文件: NettySession.java

@Override
public int hashCode() {
    HashCodeBuilder hash = new HashCodeBuilder();
    hash.append(key);
    hash.append(context);
    return hash.toHashCode();
}
 
源代码16 项目: uyuni   文件: ServerSnapshot.java

/**
 *
 * {@inheritDoc}
 */
@Override
public int hashCode() {
    return new HashCodeBuilder().append(reason.hashCode())
                                .append(channels.hashCode())
                                .append(configChannels.hashCode())
                                .append(configRevisions.hashCode())
                                .append(server.hashCode())
                                .append(groups.hashCode())
                                .toHashCode();
}
 
源代码17 项目: jstarcraft-ai   文件: NesterovLearner.java

@Override
public int hashCode() {
    HashCodeBuilder hash = new HashCodeBuilder();
    hash.append(learnSchedule);
    hash.append(momentumSchedule);
    return hash.toHashCode();
}
 
源代码18 项目: spider   文件: SpiderInfo.java

@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
            .append(getThread())
            .append(getRetry())
            .append(getSleep())
            .append(getMaxPageGather())
            .append(getTimeout())
            .append(getPriority())
            .append(isGatherFirstPage())
            .append(getSiteName())
            .append(getDomain())
            .append(getStartURL())
            .append(getContentReg())
            .append(getContentXPath())
            .append(getTitleReg())
            .append(getTitleXPath())
            .append(getCategoryReg())
            .append(getCategoryXPath())
            .append(getDefaultCategory())
            .append(getUrlReg())
            .append(getCharset())
            .append(getPublishTimeXPath())
            .append(getPublishTimeReg())
            .append(getPublishTimeFormat())
            .append(isDoNLP())
            .append(isNeedTitle())
            .append(isNeedContent())
            .append(isNeedPublishTime())
            .append(getLang())
            .append(getCountry())
            .append(getUserAgent())
            .append(getDynamicFields())
            .append(getStaticFields())
            .append(isSaveCapture())
            .append(isAutoDetectPublishDate())
            .toHashCode();
}
 

/**
 * The hashcode is following the same idea as the {@link #compareTo(ApacheCloudStackApiCommandParameter)} method.
 */
@Override
public int hashCode() {
    HashCodeBuilder hashCodeBuilder = new HashCodeBuilder();
    hashCodeBuilder.append(this.name);
    return hashCodeBuilder.toHashCode();
}
 
源代码20 项目: sakai   文件: Comment.java

@Override
public int hashCode() {
       return new HashCodeBuilder().
         append(gradableObject).
         append(id).
         append(commentText).
         toHashCode();
}
 
源代码21 项目: jkube   文件: Maintainer.java

@Override
public int hashCode() {
  return new HashCodeBuilder(17, 37)
      .append(name)
      .append(email)
      .toHashCode();
}
 
源代码22 项目: uyuni   文件: ContentFilter.java

@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
            .append(org)
            .append(name)
            .toHashCode();
}
 
源代码23 项目: feilong-taglib   文件: HttpConcatParam.java

@Override
public int hashCode(){
    //返回该对象的哈希码值  支持此方法是为了提高哈希表(例如 java.util.Hashtable 提供的哈希表)的性能. 

    //当我们向一个集合中添加某个元素,集合会首先调用hashCode方法,这样就可以直接定位它所存储的位置,
    //若该处没有其他元素,则直接保存.

    //若该处已经有元素存在,
    //就调用equals方法来匹配这两个元素是否相同,相同则不存,
    //不同则散列到其他位置(具体情况请参考(Java提高篇()-----HashMap)).

    //这样处理,当我们存入大量元素时就可以大大减少调用equals()方法的次数,极大地提高了效率.

    //hashCode在上面扮演的角色为寻域(寻找某个对象在集合中区域位置)

    //---------------------------------------------------------------
    //可替代地,存在使用反射来确定测试中的字段的方法.
    //因为这些字段通常是私有的,该方法中,reflectionHashCode,使用AccessibleObject.setAccessible改变字段的可见性.
    //这点会在一个安全管理器失败,除非相应的权限设置是否正确.
    //它也比明确地测试速度较慢. 
    //HashCodeBuilder.reflectionHashCode(this)
    //---------------------------------------------------------------
    //你选择一个硬编码,随机选择,不为零,奇数 
    //理想情况下,每个类不同

    HashCodeBuilder hashCodeBuilder = new HashCodeBuilder(3, 5);
    return hashCodeBuilder//
                    .append(this.domain)//
                    .append(this.httpConcatSupport)//
                    .append(this.root)//
                    .append(this.type)//
                    .append(this.version)//
                    .append(this.domain)//
                    .append(this.content)//
                    .toHashCode();
}
 
源代码24 项目: VocabHunter   文件: SessionWord.java

@Override
public int hashCode() {
    return new HashCodeBuilder()
        .append(wordIdentifier)
        .append(uses)
        .append(lineNos)
        .append(useCount)
        .append(state)
        .append(note)
        .toHashCode();
}
 
源代码25 项目: bonita-ui-designer   文件: Widget.java

@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
            .append(id)
            .append(name)
            .append(template)
            .append(controller)
            .append(custom)
            .append(properties)
            .append(hasHelp)
            .toHashCode();
}
 

@Override
public int hashCode() {
	return new HashCodeBuilder()
		.append(vertexCount)
		.append(averageLocalClusteringCoefficient)
		.hashCode();
}
 
源代码27 项目: cloudbreak   文件: ConfigProperty.java

@Override
public int hashCode() {
    return new HashCodeBuilder(17, 37)
            .append(name)
            .append(prefix)
            .append(directory)
            .toHashCode();
}
 

@Override
public int hashCode() {
    return new HashCodeBuilder()
            .appendSuper(super.hashCode())
            .append(allowedAttributes)
            .toHashCode();
}
 
源代码29 项目: angelix   文件: NotEqual.java

@Override
public int hashCode() {
    return new HashCodeBuilder(17, 31).
            append(left).
            append(right).
            toHashCode();
}
 

@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_why = true && (isSetWhy());
  builder.append(present_why);
  if (present_why)
    builder.append(why);

  return builder.toHashCode();
}
 
 类所在包
 同包方法