当前位置: 首页>>代码示例>>Java>>正文


Java MoreObjects类代码示例

本文整理汇总了Java中com.google.common.base.MoreObjects的典型用法代码示例。如果您正苦于以下问题:Java MoreObjects类的具体用法?Java MoreObjects怎么用?Java MoreObjects使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MoreObjects类属于com.google.common.base包,在下文中一共展示了MoreObjects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    final ToStringHelper stringHelper = MoreObjects.toStringHelper(this)
                                                   .add("name", name());
    if (creator() != null) {
        stringHelper.add("creator", creator());
    }

    if (headRevision() != null) {
        stringHelper.add("headRevision", headRevision());
    }

    if (createdAt() != null) {
        stringHelper.add("createdAt", createdAt());
    }

    return stringHelper.toString();
}
 
开发者ID:line,项目名称:centraldogma,代码行数:19,代码来源:RepositoryDto.java

示例2: generateUriPredicate

import com.google.common.base.MoreObjects; //导入依赖的package包/类
private Predicate<URI> generateUriPredicate(FileInput fileInput, @Nullable Predicate<URI> globPredicate) {
    Predicate<URI> moduloPredicate;
    boolean sharedStorage = MoreObjects.firstNonNull(shared, fileInput.sharedStorageDefault());
    if (sharedStorage) {
        moduloPredicate = new Predicate<URI>() {
            @Override
            public boolean apply(URI input) {
                int hash = input.hashCode();
                if (hash == Integer.MIN_VALUE) {
                    hash = 0; // Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE
                }
                return Math.abs(hash) % numReaders == readerNumber;
            }
        };
    } else {
        moduloPredicate = MATCH_ALL_PREDICATE;
    }

    if (globPredicate != null) {
        return Predicates.and(moduloPredicate, globPredicate);
    }
    return moduloPredicate;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:FileReadingCollector.java

示例3: dump

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override public String dump() {
  lock.lock();
  try {
    return addSubclassFields(
        MoreObjects.toStringHelper(this).add("seed", BinaryUtils.convertBytesToHexString(seed))
            .add("entropyBits", entropyBits.get()).add("seedGenerator", seedGenerator))
        .toString();
  } finally {
    lock.unlock();
  }
}
 
开发者ID:Pr0methean,项目名称:BetterRandom,代码行数:12,代码来源:BaseRandom.java

示例4: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("value", value)
            .add("userdata", userData)
            .add("created", created)
            .add("modified", modified)
            .add("comment", comment)
            .toString();
}
 
开发者ID:schibsted,项目名称:strongbox,代码行数:11,代码来源:EncryptionPayload.java

示例5: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(getClass())
            .add("number", portNumber())
            .add("isEnabled", isEnabled())
            .add("type", type())
            .add("minFrequency", minFrequency)
            .add("maxFrequency", maxFrequency)
            .add("grid", grid)
            .add("annotations", annotations())
            .toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:OmsPortDescription.java

示例6: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString()
{
    return MoreObjects.toStringHelper(this)
            .add("version", version)
            .add("modLoaders", modLoaders)
            .toString();
}
 
开发者ID:PaleoCrafter,项目名称:CurseSync,代码行数:9,代码来源:PackManifest.java

示例7: debugString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
public String debugString()
{
    return MoreObjects.toStringHelper(this)
                      .add("name", name)
                      .add("type", type)
                      .add("kind", kind)
                      .add("position", position)
                      .toString();
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:10,代码来源:ColumnDefinition.java

示例8: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(getClass())
            .omitNullValues()
            .add("administrativeGroup", administrativeGroup)
            .add("ipv4InterfaceAddress", ipv4InterfaceAddress)
            .add("ipv4NeighborAddress", ipv4NeighborAddress)
            .add("maximumLinkBandwidth", maximumLinkBandwidth)
            .add("maximumReservableLinkBandwidth", maximumReservableLinkBandwidth)
            .add("teDefaultMetric", teDefaultMetric)
            .toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:DefaultIsisLinkTed.java

示例9: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(getClass())
            .add("transactionId", transactionId)
            .add("updates", updates)
            .toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:8,代码来源:MapTransaction.java

示例10: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    if (friendlyName != NO_NAME) {
        return MoreObjects.toStringHelper(getClass())
                .omitNullValues()
                .add("friendlyName", friendlyName)
                // omit lengthy detail, when there's a name
                .toString();
    }
    return MoreObjects.toStringHelper(getClass())
                .add("registeredBlocks", registeredBlocks)
                .toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:KryoNamespace.java

示例11: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(getClass())
        .add("nodeId", nodeId)
        .add("term", term)
        .add("termStartTime", termStartTime)
        .toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:Leader.java

示例12: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(getClass())
            .omitNullValues()
            .add("externalInformation", externalInformation)
            .add("irdpInformationType", irdpInformationType)
            .toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:IdrpInformationTlv.java

示例13: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("ident", ident)
            .add("method", method)
            .add("columns", columns)
            .add("properties", properties)
            .toString();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:IndexDefinition.java

示例14: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
    return MoreObjects.toStringHelper(this)
            .add("symbol", symbol)
            .add("earnings", earnings)
            .toString();
}
 
开发者ID:WojciechZankowski,项目名称:iextrading4j,代码行数:8,代码来源:Earnings.java

示例15: toString

import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
  return MoreObjects.toStringHelper(this)
      .add("domain", domain)
      .add("ordinal", ordinal)
      .toString();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:Ord.java


注:本文中的com.google.common.base.MoreObjects类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。