本文整理汇总了Java中org.threeten.bp.Instant.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Instant.toString方法的具体用法?Java Instant.toString怎么用?Java Instant.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.threeten.bp.Instant
的用法示例。
在下文中一共展示了Instant.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubscriptionTrace
import org.threeten.bp.Instant; //导入方法依赖的package包/类
@Override
public SubscriptionTrace getSubscriptionTrace(String identifier) {
if (_securityUniqueId2Subscription.containsKey(identifier)) {
Subscription sub = _securityUniqueId2Subscription.get(identifier);
Date creationTime = sub.getCreationTime();
Instant instant = Instant.ofEpochMilli(creationTime.getTime());
Set<DistributorTrace> distributors = new HashSet<>();
for (MarketDataDistributor distributor : sub.getDistributors()) {
distributors.add(new DistributorTrace(
distributor.getDistributionSpec().getJmsTopic(),
Instant.ofEpochMilli(distributor.getExpiry()).toString(),
distributor.hasExpired(),
distributor.isPersistent(),
distributor.getNumMessagesSent()));
}
return new SubscriptionTrace(identifier, instant.toString(), distributors, sub.getLiveDataHistory().getLastKnownValues().toString());
} else {
return new SubscriptionTrace(identifier);
}
}
示例2: createTimeSeriesUniqueId
import org.threeten.bp.Instant; //导入方法依赖的package包/类
/**
* Creates a unique identifier.
*
* @param oid the object identifier
* @param verInstant the version instant, not null
* @param corrInstant the correction instant, not null
* @return the unique identifier
*/
protected UniqueId createTimeSeriesUniqueId(long oid, Instant verInstant, Instant corrInstant) {
String oidStr = DATA_POINT_PREFIX + oid;
Duration dur = Duration.between(verInstant, corrInstant);
String verStr = verInstant.toString() + dur.toString();
return UniqueId.of(getUniqueIdScheme(), oidStr, verStr);
}
示例3: uriValuationTime
import org.threeten.bp.Instant; //导入方法依赖的package包/类
/**
* Builds URI for remote access to getTraceWithValuationTime.
* @param baseUri the base uri
* @param valuationInstant the valuation time
* @return the URI
*/
public static URI uriValuationTime(URI baseUri, Instant valuationInstant) {
String valuationInstantStr = valuationInstant.toString();
UriBuilder bld = UriBuilder.fromUri(baseUri).path("valuationTime/{valuationTime}");
return bld.build(valuationInstantStr);
}