當前位置: 首頁>>代碼示例>>Java>>正文


Java ToStringHelper.toString方法代碼示例

本文整理匯總了Java中com.google.common.base.MoreObjects.ToStringHelper.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java ToStringHelper.toString方法的具體用法?Java ToStringHelper.toString怎麽用?Java ToStringHelper.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.base.MoreObjects.ToStringHelper的用法示例。


在下文中一共展示了ToStringHelper.toString方法的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();
}
 
開發者ID:airlift,項目名稱:drift,代碼行數:17,代碼來源:UnionBuilder.java

示例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();
}
 
開發者ID:line,項目名稱:centraldogma,代碼行數:20,代碼來源:EntryDto.java

示例3: toString

import com.google.common.base.MoreObjects.ToStringHelper; //導入方法依賴的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

示例4: 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;
}
 
開發者ID:google,項目名稱:copybara,代碼行數:20,代碼來源:Workflow.java

示例5: 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();
}
 
開發者ID:line,項目名稱:armeria,代碼行數:18,代碼來源:DefaultAggregatedHttpMessage.java

示例6: 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();
}
 
開發者ID:jronrun,項目名稱:benayn,代碼行數:21,代碼來源:TypeRefer.java

示例7: toString

import com.google.common.base.MoreObjects.ToStringHelper; //導入方法依賴的package包/類
/**
 * toString
 *
 * @return String representation
 */
@Override
public String toString()
{
	final ToStringHelper builder = MoreObjects.toStringHelper(this);
	final GridTabVO vo = m_vo;
	if (vo != null)
	{
		builder.add("TabNo", vo.getTabNo())
				.add("TabLevel", vo.getTabLevel())
				.add("Name", vo.getName())
				.add("AD_Tab_ID", vo.getAD_Tab_ID())
				.add("TableName", vo.getTableName());
	}
	else
	{
		builder.addValue("no VO");
	}
	return builder.toString();
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:25,代碼來源:GridTab.java

示例8: 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();
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:21,代碼來源:CassandraColumnHandle.java

示例9: 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();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:NexthopIPv6addressTlv.java

示例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();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:IPv6RouterIdofLocalNodeSubTlv.java

示例11: toString

import com.google.common.base.MoreObjects.ToStringHelper; //導入方法依賴的package包/類
@Override
public String toString() {
    final ToStringHelper helper = MoreObjects.toStringHelper(this)
                                             .add("hostnamePatterns", hostnamePatterns);
    addProperties(helper);
    return helper.toString();
}
 
開發者ID:line,項目名稱:centraldogma,代碼行數:8,代碼來源:AbstractMirrorCredential.java

示例12: toString

import com.google.common.base.MoreObjects.ToStringHelper; //導入方法依賴的package包/類
@Override
public String toString() {
    final ToStringHelper stringHelper = MoreObjects.toStringHelper(this)
                                                   .add("summary", summary());
    if (!isNullOrEmpty(detail)) {
        stringHelper.add("detail", detail());
        stringHelper.add("markup", markup());
    }
    return stringHelper.toString();
}
 
開發者ID:line,項目名稱:centraldogma,代碼行數:11,代碼來源:CommitMessageDto.java

示例13: toString

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

    if (createdAt() != null) {
        stringHelper.add("createdAt", createdAt());
    }
    return stringHelper.toString();
}
 
開發者ID:line,項目名稱:centraldogma,代碼行數:14,代碼來源:ProjectDto.java

示例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();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:16,代碼來源:PcepStateReportVer1.java

示例15: toString

import com.google.common.base.MoreObjects.ToStringHelper; //導入方法依賴的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


注:本文中的com.google.common.base.MoreObjects.ToStringHelper.toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。