當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。