本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}