本文整理汇总了Java中com.google.common.base.MoreObjects.ToStringHelper.add方法的典型用法代码示例。如果您正苦于以下问题:Java ToStringHelper.add方法的具体用法?Java ToStringHelper.add怎么用?Java ToStringHelper.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.base.MoreObjects.ToStringHelper
的用法示例。
在下文中一共展示了ToStringHelper.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString()
{
ToStringHelper helper = toStringHelper(this);
if (type == 1) {
helper.add("stringValue", value);
}
else if (type == 2) {
helper.add("longValue", value);
}
else if (type == 3) {
helper.add("fruitValue", value);
}
return helper.toString();
}
示例2: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString() {
final ToStringHelper stringHelper = MoreObjects.toStringHelper(this)
.add("path", path())
.add("type", type());
if (content() != null) {
stringHelper.add("content", content());
}
if (revision() != null) {
stringHelper.add("revision", revision());
}
if (modifiedAt() != null) {
stringHelper.add("modifiedAt", modifiedAt());
}
return stringHelper.toString();
}
示例3: computeIdentity
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
private String computeIdentity(String type, String ref) {
ToStringHelper helper = MoreObjects.toStringHelper(type)
.add("type", "workflow")
.add("config_path", mainConfigFile.relativeToRoot())
.add("workflow_name", this.name)
.add("context_ref", ref);
helper.add("user", workflowOptions.workflowIdentityUser != null
? workflowOptions.workflowIdentityUser
: StandardSystemProperty.USER_NAME.value());
String identity = helper.toString();
String hash = BaseEncoding.base16().encode(
Hashing.md5()
.hashString(identity, StandardCharsets.UTF_8)
.asBytes());
// Important to log the source of the hash and the hash for debugging purposes.
logger.info("Computed migration identity hash for " + identity + " as " + hash);
return hash;
}
示例4: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override public String toString() {
ToStringHelper helper = MoreObjects.toStringHelper(TypeDescrib.class);
helper.add("level", this.level);
helper.add("isPair", this.isPair);
helper.add("describe", this.describe);
if (null != this.rawType) {
helper.add("rawType", this.rawType.getName());
}
if (this.hasChild()) {
int idx = 0;
for (TypeDescrib typeDescrib : this.childTypes) {
helper.add("childType" + idx, typeDescrib.toString());
idx++;
}
}
return helper.toString();
}
示例5: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
protected void toString(final ToStringHelper stringHelper)
{
stringHelper
.add("id", id)
.add("huKey", huKey)
.add("hu", hu)
.add("objectId", System.identityHashCode(this))
.add("disposed", disposed);
if (disposed)
{
stringHelper.add("disposedTS", disposedTS);
stringHelper.add("disposedStackTrace", Util.dumpStackTraceToString(disposedStackTrace));
}
}
示例6: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString()
{
ToStringHelper helper = toStringHelper(this)
.add("connectorId", connectorId)
.add("name", name)
.add("ordinalPosition", ordinalPosition)
.add("cassandraType", cassandraType);
if (typeArguments != null && !typeArguments.isEmpty()) {
helper.add("typeArguments", typeArguments);
}
helper.add("partitionKey", partitionKey)
.add("clusteringKey", clusteringKey)
.add("indexed", indexed)
.add("hidden", hidden);
return helper.toString();
}
示例7: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString() {
final ToStringHelper stringHelper = MoreObjects.toStringHelper(this)
.add("specification", specification);
if (baseOption == BaseOption.fixed) {
stringHelper.add("fixedDelayMillis", fixedDelayMillis);
} else if (baseOption == BaseOption.random) {
stringHelper.add("randomMinDelayMillis", randomMinDelayMillis)
.add("randomMaxDelayMillis", randomMaxDelayMillis);
} else {
stringHelper.add("initialDelayMillis", initialDelayMillis).add("maxDelayMillis", maxDelayMillis)
.add("multiplier", multiplier);
}
stringHelper.add("minJitterRate", minJitterRate).add("maxJitterRate", maxJitterRate);
if (maxAttemptsConfigured) {
stringHelper.add("maxAttempts", maxAttempts);
}
return stringHelper.toString();
}
示例8: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString() {
final ToStringHelper helper = MoreObjects.toStringHelper(this);
if (!informationals().isEmpty()) {
helper.add("informationals", informationals());
}
helper.add("headers", headers())
.add("content", content());
if (!trailingHeaders().isEmpty()) {
helper.add("trailingHandlers", trailingHeaders());
}
return helper.toString();
}
示例9: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString() {
final ToStringHelper toStringHelper = MoreObjects.toStringHelper(this);
for (Definition definition : getRow().getColumnDefinitions().asList()) {
toStringHelper.add(definition.getName(), toString(definition.getName(), definition.getType()));
}
String s = "[" + result.getExecutionInfo().getQueriedHost() + "] "+ toStringHelper.toString();
if (result.getExecutionInfo().getQueryTrace() != null) {
StringBuilder sb = new StringBuilder("\n");
for (Event event : result.getExecutionInfo().getQueryTrace().getEvents()) {
sb.append(event.getSource() + " - " + event.getSourceElapsedMicros() + ": " + event.getDescription() +"\n");
}
s = s + sb.toString();
}
return s;
}
示例10: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的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();
}
示例11: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的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();
}
示例12: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的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();
}
示例13: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString() {
ToStringHelper helper = MoreObjects.toStringHelper(this).add("type", type);
if (comparator != null) {
helper.add("comparator", comparator);
}
return helper.toString();
}
示例14: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的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();
}
示例15: toString
import com.google.common.base.MoreObjects.ToStringHelper; //导入方法依赖的package包/类
@Override
public String toString() {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()).omitNullValues();
if ((errObjListWithOpen != null)
&& (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
toStrHelper.add("ErrorObjectListWithOpen", errObjListWithOpen);
}
if ((errInfo != null) && (errInfo.isErrorInfoPresent())) {
toStrHelper.add("ErrorInfo", errInfo);
}
return toStrHelper.toString();
}