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


Java ToStringHelper类代码示例

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


ToStringHelper类属于com.google.common.base.MoreObjects包,在下文中一共展示了ToStringHelper类的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 helper = MoreObjects.toStringHelper("")
                                             .add("schedule", CronDescriptor.instance().describe(schedule))
                                             .add("direction", direction)
                                             .add("localRepo", localRepo.name())
                                             .add("localPath", localPath)
                                             .add("remoteRepo", remoteRepoUri)
                                             .add("remotePath", remotePath);
    if (remoteBranch != null) {
        helper.add("remoteBranch", remoteBranch);
    }

    helper.add("credential", credential);

    return helper.toString();
}
 
开发者ID:line,项目名称:centraldogma,代码行数:18,代码来源:Mirror.java

示例3: 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

示例4: 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

示例5: 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

示例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包/类
@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));
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:17,代码来源:HUKeyAttributeStorage.java

示例8: 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

示例9: 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

示例10: 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();
}
 
开发者ID:line,项目名称:armeria,代码行数:22,代码来源:BackoffSpec.java

示例11: 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

示例12: 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;
}
 
开发者ID:1and1,项目名称:Troilus,代码行数:21,代码来源:RecordImpl.java

示例13: registerSource

import com.google.common.base.MoreObjects.ToStringHelper; //导入依赖的package包/类
/**
 * Register a URL containing a YANG text.
 *
 * @param url YANG text source URL
 * @return a YangTextSchemaSourceRegistration for this URL
 * @throws YangSyntaxErrorException When the YANG file is syntactically invalid
 * @throws IOException when the URL is not readable
 * @throws SchemaSourceException When parsing encounters general error
 */
public YangTextSchemaSourceRegistration registerSource(@Nonnull final URL url) throws SchemaSourceException,
        IOException, YangSyntaxErrorException {
    checkArgument(url != null, "Supplied URL must not be null");

    final String path = url.getPath();
    final String fileName = path.substring(path.lastIndexOf('/') + 1);
    final SourceIdentifier guessedId = guessSourceIdentifier(fileName);
    return registerSource(new YangTextSchemaSource(guessedId) {
        @Override
        public InputStream openStream() throws IOException {
            return url.openStream();
        }

        @Override
        protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
            return toStringHelper.add("url", url);
        }
    });
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:29,代码来源:YangTextSchemaContextResolver.java

示例14: 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

示例15: addProperties

import com.google.common.base.MoreObjects.ToStringHelper; //导入依赖的package包/类
@Override
void addProperties(ToStringHelper helper) {
    final String publicKeyPreview;
    if (publicKey.length > PUBLIC_KEY_PREVIEW_LEN) {
        publicKeyPreview = new String(publicKey, 0, PUBLIC_KEY_PREVIEW_LEN, StandardCharsets.UTF_8) + "..";
    } else {
        publicKeyPreview = new String(publicKey, StandardCharsets.UTF_8);
    }

    helper.add("username", username)
          .add("publicKey", publicKeyPreview);
}
 
开发者ID:line,项目名称:centraldogma,代码行数:13,代码来源:PublicKeyMirrorCredential.java


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