本文整理汇总了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;
}
}
示例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);
}
示例3: toString
import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String toString() {
if (!isLogical()) {
return UnsignedLongs.toString(number);
} else {
return decodeLogicalPort();
}
}
示例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);
}
示例5: PortNumber
import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
private PortNumber(long number) {
this.number = number;
this.name = UnsignedLongs.toString(number);
this.hasName = false;
}
示例6: ulongToString
import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
public static String ulongToString(long value) {
return UnsignedLongs.toString(value);
}
示例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));
}
示例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);
}
示例9: toString
import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String toString() {
return "{t: " + timestamp + ", i: " + UnsignedLongs.toString(term) + "}";
}
示例10: toString
import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String toString() {
return UnsignedLongs.toString(seq);
}
示例11: visitUnsignedInt
import com.google.common.primitives.UnsignedLongs; //导入方法依赖的package包/类
@Override
public String visitUnsignedInt(long value) {
return UnsignedLongs.toString(value);
}
示例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);
}