當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。