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


Java Timestamps.toString方法代码示例

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


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

示例1: valueToTimestamp

import com.google.protobuf.util.Timestamps; //导入方法依赖的package包/类
@Nullable
private String valueToTimestamp(Value v) {
  boolean isTimestampValue = v.getValueTypeCase().equals(ValueTypeCase.TIMESTAMP_VALUE);
  if (!isTimestampValue) {
    return null;
  }

  return Timestamps.toString(v.getTimestampValue());
}
 
开发者ID:cobookman,项目名称:teleport,代码行数:10,代码来源:EntityBQTransform.java

示例2: assertAtLevel

import com.google.protobuf.util.Timestamps; //导入方法依赖的package包/类
private void assertAtLevel(Level level) {
    final LoggingObserver<Object> observer = getObserver(level);

    assertNotNull(observer);

    // Since we're in the tests mode `Environment` returns `SubstituteLogger` instance.
    final SubstituteLogger log = (SubstituteLogger) observer.log();

    // Restrict the queue size only to the number of calls we want to make.
    final Queue<SubstituteLoggingEvent> queue = Queues.newArrayBlockingQueue(3);
    log.setDelegate(new EventRecodingLogger(log, queue));

    SubstituteLoggingEvent loggingEvent;

    final String value = newUuid();
    observer.onNext(value);
    loggingEvent = queue.poll();
    assertNotNull(loggingEvent);
    assertLogLevel(loggingEvent, level);
    assertContains(loggingEvent, value);
    assertContains(loggingEvent, "onNext");

    final Timestamp currentTime = Time.getCurrentTime();
    final String timeStr = Timestamps.toString(currentTime);
    observer.onNext(currentTime);
    loggingEvent = queue.poll();
    assertNotNull(loggingEvent);
    assertLogLevel(loggingEvent, level);
    assertContains(loggingEvent, timeStr);

    observer.onCompleted();
    loggingEvent = queue.poll();
    assertNotNull(loggingEvent);
    assertLogLevel(loggingEvent, level);
    assertContains(loggingEvent, "onCompleted");
}
 
开发者ID:SpineEventEngine,项目名称:core-java,代码行数:37,代码来源:LoggingObserverShould.java

示例3: logItem

import com.google.protobuf.util.Timestamps; //导入方法依赖的package包/类
private static StringValue logItem(String digitalPart) {
    final String str =
            Timestamps.toString(Time.getCurrentTime())
                    + " - "
                    + digitalPart;
    return StringValue.newBuilder()
                      .setValue(str)
                      .build();
}
 
开发者ID:SpineEventEngine,项目名称:core-java,代码行数:10,代码来源:AggregateMessageDispatcherTestEnv.java

示例4: convert

import com.google.protobuf.util.Timestamps; //导入方法依赖的package包/类
@Override
public String convert(MessageOrBuilder message) throws IOException {
    Timestamp value = Timestamp.parseFrom(toByteString(message));
    return ("\"" + Timestamps.toString(value) + "\"");
}
 
开发者ID:SeldonIO,项目名称:seldon-core,代码行数:6,代码来源:TimeUtils.java


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