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


Java MoreObjects.toStringHelper方法代码示例

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


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

示例1: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
/**
 * Returns a string representation for this MapMaker instance. The exact form of the returned
 * string is not specified.
 */
@Override
public String toString() {
  MoreObjects.ToStringHelper s = MoreObjects.toStringHelper(this);
  if (initialCapacity != UNSET_INT) {
    s.add("initialCapacity", initialCapacity);
  }
  if (concurrencyLevel != UNSET_INT) {
    s.add("concurrencyLevel", concurrencyLevel);
  }
  if (keyStrength != null) {
    s.add("keyStrength", Ascii.toLowerCase(keyStrength.toString()));
  }
  if (valueStrength != null) {
    s.add("valueStrength", Ascii.toLowerCase(valueStrength.toString()));
  }
  if (keyEquivalence != null) {
    s.addValue("keyEquivalence");
  }
  return s.toString();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:25,代码来源:MapMaker.java

示例2: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    final MoreObjects.ToStringHelper stringHelper = MoreObjects.toStringHelper(this);
    asMap().forEach((k, v) -> {
        stringHelper.add(k, v);
    });

    return stringHelper.toString();
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:10,代码来源:MessageFields.java

示例3: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
/**
 * Returns a string representation for this CacheBuilder instance. The exact form of the returned
 * string is not specified.
 */
@Override
public String toString() {
  MoreObjects.ToStringHelper s = MoreObjects.toStringHelper(this);
  if (initialCapacity != UNSET_INT) {
    s.add("initialCapacity", initialCapacity);
  }
  if (concurrencyLevel != UNSET_INT) {
    s.add("concurrencyLevel", concurrencyLevel);
  }
  if (maximumSize != UNSET_INT) {
    s.add("maximumSize", maximumSize);
  }
  if (maximumWeight != UNSET_INT) {
    s.add("maximumWeight", maximumWeight);
  }
  if (expireAfterWriteNanos != UNSET_INT) {
    s.add("expireAfterWrite", expireAfterWriteNanos + "ns");
  }
  if (expireAfterAccessNanos != UNSET_INT) {
    s.add("expireAfterAccess", expireAfterAccessNanos + "ns");
  }
  if (keyStrength != null) {
    s.add("keyStrength", Ascii.toLowerCase(keyStrength.toString()));
  }
  if (valueStrength != null) {
    s.add("valueStrength", Ascii.toLowerCase(valueStrength.toString()));
  }
  if (keyEquivalence != null) {
    s.addValue("keyEquivalence");
  }
  if (valueEquivalence != null) {
    s.addValue("valueEquivalence");
  }
  if (removalListener != null) {
    s.addValue("removalListener");
  }
  return s.toString();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:43,代码来源:CacheBuilder.java

示例4: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this);
    if (noMatch()) {
        helper.add("NO_MATCH", true);
    } else if (!hasQuery()) {
        helper.add("MATCH_ALL", true);
    } else {
        helper.add("query", query);
    }
    return helper.toString();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:WhereClause.java

示例5: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this);
    helper.add("locations", locations);
    return helper.toString();

}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:Routing.java

示例6: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    ToStringHelper helper = MoreObjects.toStringHelper("byte[]");
    if (bytes != null) {
        helper.add("length", bytes.length)
              .add("hash", Arrays.hashCode(bytes));
    } else {
        helper.addValue(bytes);
    }
    return helper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:ByteArraySizeHashPrinter.java

示例7: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());

    if (attrList != null) {
        toStrHelper.add("AttributeList", attrList);
    }
    if (rroObj instanceof PcepRroObjectVer1) {
        toStrHelper.add("RroObject", rroObj);
    }
    if (bandwidth instanceof PcepBandwidthObjectVer1) {
        toStrHelper.add("bandwidthObject", bandwidth);
    }
    return toStrHelper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:PcepStateReportVer1.java

示例8: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());

    toStrHelper.add("Type", TYPE);
    toStrHelper.add("Length", hLength);

    StringBuffer result = new StringBuffer();
    for (byte b : rawValue) {
        result.append(String.format("%02X ", b));
    }
    toStrHelper.add("Value", result);

    return toStrHelper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:NodeNameSubTlv.java

示例9: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());

    toStrHelper.add("Type", TYPE);
    toStrHelper.add("Length", LENGTH);

    StringBuffer result = new StringBuffer();
    for (byte b : rawValue) {
        result.append(String.format("%02X ", b));
    }
    toStrHelper.add("IpAddress", result);

    return toStrHelper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:NexthopIPv6addressTlv.java

示例10: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this);
    parameterMap.forEach((name, param) -> {
        switch (param.type()) {
            case EXACT:
                Bmv2ExactMatchParam e = (Bmv2ExactMatchParam) param;
                helper.add(name, e.value());
                break;
            case TERNARY:
                Bmv2TernaryMatchParam t = (Bmv2TernaryMatchParam) param;
                helper.add(name, t.value() + "&&&" + t.mask());
                break;
            case LPM:
                Bmv2LpmMatchParam l = (Bmv2LpmMatchParam) param;
                helper.add(name, l.value() + "/" + String.valueOf(l.prefixLength()));
                break;
            case VALID:
                Bmv2ValidMatchParam v = (Bmv2ValidMatchParam) param;
                helper.add(name, v.flag() ? "VALID" : "NOT_VALID");
                break;
            default:
                helper.add(name, param);
                break;
        }
    });
    return helper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:29,代码来源:Bmv2ExtensionSelector.java

示例11: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());

    toStrHelper.add("Type", TYPE);
    toStrHelper.add("Length", LENGTH);

    StringBuffer result = new StringBuffer();
    for (byte b : rawValue) {
        result.append(String.format("%02X ", b));
    }
    toStrHelper.add("Value", result);

    return toStrHelper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:IPv6RouterIdofRemoteNodeSubTlv.java

示例12: toString

import com.google.common.base.MoreObjects; //导入方法依赖的package包/类
@Override
public String toString() {
    ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());

    toStrHelper.add("Type", TYPE);
    toStrHelper.add("Length", hLength);

    StringBuffer result = new StringBuffer();
    for (int b : srlgValue) {
        result.append(String.format("%02X ", b));
    }
    toStrHelper.add("Value", result);

    return toStrHelper.toString();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:SharedRiskLinkGroupSubTlv.java


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