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


Java UnsignedLongs.toString方法代码示例

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


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

示例1: newInstance

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public YamlProject<T> newInstance(final Branch branch) {
  try {
    // If the branch name contains '/' then use its MD5 hash
    // as the project name, but otherwise use the branch name
    // for backwards compatibility.
    final String hashedName = UnsignedLongs.toString(Hashing.md5().hashString(
        branch.getName(), Charsets.UTF_8).asLong(), 16);
    final String projectName =
        branch.getName().indexOf('/') == -1 ? branch.getName() : hashedName;
    final YamlProject<T> project = new YamlProject<T>(
        (YamlMultiBranchProject<T>) getOwner(),
        projectName, null /* module */);

    // Set the display name so that it is always the branch name.
    project.setDisplayName(branch.getName());

    project.setBranch(branch);

    return decorate(project);
  } catch (IOException e) {
    logger.log(SEVERE, e.getMessage(), e);
    return null;
  }
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:27,代码来源:YamlProjectFactory.java

示例2: logState

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
/**
 * Logs the current the state of the permutation.
 * Intended only for debugging purposes.
 *
 * @param message message to be used as title of the current state
 */

private void logState(String message) {
    String logEntry = message + "[ ";
    for (int y = 0; y < 5; y++) {
        logEntry += "\t[ ";
        for (int x = 0; x < 5; x++) {
            logEntry += "0x" + UnsignedLongs.toString(this.state[x][y], 16) + ", ";
        }
        logEntry += " ]";
    }
    logEntry += " ]";

    //Log.debug(logEntry);
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:21,代码来源:Keccak.java

示例3: toString

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String toString() {
    if (!isLogical()) {
        return UnsignedLongs.toString(number);
    } else {
        return decodeLogicalPort();
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:9,代码来源:PortNumber.java

示例4: getOrCreateProject

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
/**
 * Determine whether a project exists for the json loaded from the DSL file.
 */
private AbstractProject getOrCreateProject(JSONObject json)
    throws IOException {
  final String jsonText = json.toString();
  final String hash = UnsignedLongs.toString(
      Hashing.md5().hashString(jsonText, Charsets.UTF_8).asLong(), 16);

  final YamlProject<T> parent = YamlBuild.this.getParent();
  final YamlHistoryAction action =
      YamlHistoryAction.of(YamlBuild.this.getPreviousBuild());
  // First build, there is no project to re-use
  if (action == null) {
    return newProject(json, hash);
  }
  final AbstractProject lastProject = action.getProject(parent);
  // If the last project had the same hash, then simply re-use it
  if (lastProject.getName().endsWith(hash)) {
    return lastProject;
  }

  // If we aren't using the lastProject then we need to blow away its
  // workspace and that of any of its descendants.
  deleteWorkspaceRecursive(lastProject);

  // Otherwise create a new one.
  return newProject(json, hash);
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:30,代码来源:YamlBuild.java

示例5: PortNumber

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
private PortNumber(long number) {
    this.number = number;
    this.name = UnsignedLongs.toString(number);
    this.hasName = false;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:PortNumber.java

示例6: ulongToString

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
public static String ulongToString(long value) {
	return UnsignedLongs.toString(value);
}
 
开发者ID:Error22,项目名称:Thelta,代码行数:4,代码来源:ALU.java

示例7: doEvaluate

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public void doEvaluate(TExecutionContext context, ValueSource source, ValueTarget target)
{
    String asString = UnsignedLongs.toString(source.getInt64());
    target.putObject(new BigDecimalWrapperImpl(asString));
}
 
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:7,代码来源:MNumericCastBase.java

示例8: writeCollating

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public void writeCollating(ValueSource in, TInstance typeInstance, ValueTarget out) {
    String asString = UnsignedLongs.toString(in.getInt64());
    BigInteger asBigint = new BigInteger(asString);
    out.putObject(asBigint);
}
 
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:7,代码来源:MNumeric.java

示例9: toString

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String toString() {
  return "{t: " + timestamp + ", i: " + UnsignedLongs.toString(term) + "}";
}
 
开发者ID:torodb,项目名称:mongowp,代码行数:5,代码来源:OpTime.java

示例10: toString

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String toString() {
    return UnsignedLongs.toString(seq);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:5,代码来源:SeqNum.java

示例11: visitUnsignedInt

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String visitUnsignedInt(long value) {
    return UnsignedLongs.toString(value);
}
 
开发者ID:reasm,项目名称:reasm-m68k,代码行数:5,代码来源:StringValueVisitor.java

示例12: getApiString

import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
/**
 * Returns this span id formatted as an unsigned long integer.
 *
 * @return The span identifier formatted for API consumption.
 */
public String getApiString() {
  return UnsignedLongs.toString(spanId);
}
 
开发者ID:GoogleCloudPlatform,项目名称:cloud-trace-java,代码行数:9,代码来源:SpanId.java


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