org.joda.time.Instant.toString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.joda.time.Instant.toString()方法的一些代码示例,展示了Instant.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instant.toString()方法的具体详情如下:
包路径:org.joda.time.Instant
类名称:Instant
方法名:toString

Instant.toString介绍

暂无

代码示例

代码示例来源:origin: spotify/helios

+ "---------- [%s UTC]%n", now.toString(formatter));
for (final TargetAndClient cc : clients) {
 final Optional<Target> target = cc.getTarget();

代码示例来源:origin: spotify/helios

if (!json) {
 out.printf(Strings.repeat("-", MAX_WIDTH - timestampLength - 1)
       + " [%s UTC]%n", now.toString(formatter));

代码示例来源:origin: org.jadira.usertype/usertype.jodatime

@Override
public String toNonNullString(Instant value) {
  return value.toString();
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

private String windowToString(BoundedWindow window) {
 if (window instanceof GlobalWindow) {
  return "GlobalWindow";
 }
 if (window instanceof IntervalWindow) {
  IntervalWindow iw = (IntervalWindow) window;
  return String.format("%s-%s", iw.start().toString(), iw.end().toString());
 }
 return window.toString();
}

代码示例来源:origin: powertac/powertac-server

void tick ()
{
 duration -= 1;
 if (duration < 0) {
  log.error(getName() + "SE start at " + start.toString()
       + " ticked past duration " + duration);
 }
 usageIndex += 1;
}

代码示例来源:origin: kiselev-dv/gazetteer

public static String getNowTimestampString() {
  LocalDateTime date = LocalDateTime.now();
  String timestampString = date.toDateTime(timeZone).toInstant().toString();
  return timestampString;
}

代码示例来源:origin: dataArtisans/flink-dataflow

@Override
  public void processElement(ProcessContext c) {
    String row = c.element().getKey() + " - " + c.element().getValue() + " @ " + c.timestamp().toString();
    System.out.println(row);
    c.output(row);
  }
}

代码示例来源:origin: org.apache.beam/beam-runners-flink_2.10-examples

@ProcessElement
 public void processElement(ProcessContext c) {
  String row = c.element().getKey() + " - " + c.element().getValue() + " @ "
    + c.timestamp().toString();
  System.out.println(row);
  c.output(row);
 }
}

代码示例来源:origin: org.apache.beam/beam-runners-flink_2.10-examples

@ProcessElement
 public void processElement(ProcessContext c) {
  String row = c.element().getKey() + " - " + c.element().getValue() + " @ "
    + c.timestamp().toString();
  c.output(row);
 }
}

代码示例来源:origin: dataArtisans/flink-dataflow

@Override
  public void processElement(ProcessContext c) {
    String row = c.element().getKey() + " - " + c.element().getValue() + " @ " + c.timestamp().toString();
    c.output(row);
  }
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@ProcessElement
 public void processElement(ProcessContext c, BoundedWindow window) {
  LOG.debug(
    "*** ELEMENT: ({},{}) *** with timestamp %s in window %s",
    c.element().getKey(),
    c.element().getValue(),
    c.timestamp().toString(),
    window.toString());
 }
}));

代码示例来源:origin: timolson/cointrader

@Override
public Trade getLastImpliedTrade(Listing listing) {
  if (listing == null)
    return null;
  try {
    long impliedPriceCount = impliedTradeMatrix.getRate(listing.getBase(), listing.getQuote()).getCount();
    Market market = context.getInjector().getInstance(Market.class).findOrCreate(Exchanges.SELF, listing);
    return new Trade(market, Instant.now(), Instant.now().toString(), impliedPriceCount, 0L);
  } catch (java.lang.IllegalArgumentException e) {
    return null;
  }
}

代码示例来源:origin: org.apache.beam/beam-runners-direct-java

@Test
public void addElementsAtEndOfTimeThrows() {
 Instant timestamp = BoundedWindow.TIMESTAMP_MAX_VALUE;
 WindowedValue<Integer> value = WindowedValue.timestampedValueInGlobalWindow(1, timestamp);
 UncommittedBundle<Integer> bundle = bundleFactory.createRootBundle();
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(timestamp.toString());
 bundle.add(value);
}

代码示例来源:origin: org.apache.beam/beam-runners-direct-java

@Test
public void addElementsAtEndOfTimeThrows() {
 Instant timestamp = BoundedWindow.TIMESTAMP_MAX_VALUE;
 WindowedValue<Integer> value = WindowedValue.timestampedValueInGlobalWindow(1, timestamp);
 UncommittedBundle<Integer> bundle = bundleFactory.createRootBundle();
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(timestamp.toString());
 bundle.add(value);
}

代码示例来源:origin: org.apache.beam/beam-examples-java

@ProcessElement
public void processElement(ProcessContext c) {
 RouteInfo routeInfo = c.element().getValue();
 TableRow row =
   new TableRow()
     .set("avg_speed", routeInfo.getAvgSpeed())
     .set("slowdown_event", routeInfo.getSlowdownEvent())
     .set("route", c.element().getKey())
     .set("window_timestamp", c.timestamp().toString());
 c.output(row);
}

代码示例来源:origin: org.apache.beam/beam-runners-apex

@ProcessElement
 public void processElement(ProcessContext c) {
  String row =
    c.element().getKey() + " - " + c.element().getValue() + " @ " + c.timestamp().toString();
  c.output(row);
 }
}

代码示例来源:origin: org.apache.beam/beam-runners-direct-java

@Test
public void timerUpdateBuilderWithSetAtEndOfTime() {
 Instant timerStamp = BoundedWindow.TIMESTAMP_MAX_VALUE;
 TimerData tooFar = TimerData.of(StateNamespaces.global(), timerStamp, TimeDomain.EVENT_TIME);
 TimerUpdateBuilder builder = TimerUpdate.builder(StructuralKey.empty());
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(timerStamp.toString());
 builder.setTimer(tooFar);
}

代码示例来源:origin: org.apache.beam/beam-runners-direct-java

@Test
public void addElementsPastEndOfTimeThrows() {
 Instant timestamp = BoundedWindow.TIMESTAMP_MAX_VALUE.plus(Duration.standardMinutes(2));
 WindowedValue<Integer> value = WindowedValue.timestampedValueInGlobalWindow(1, timestamp);
 UncommittedBundle<Integer> bundle = bundleFactory.createRootBundle();
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(timestamp.toString());
 bundle.add(value);
}

代码示例来源:origin: org.apache.beam/beam-runners-direct-java

@Test
public void addElementsPastEndOfTimeThrows() {
 Instant timestamp = BoundedWindow.TIMESTAMP_MAX_VALUE.plus(Duration.standardMinutes(2));
 WindowedValue<Integer> value = WindowedValue.timestampedValueInGlobalWindow(1, timestamp);
 UncommittedBundle<Integer> bundle = bundleFactory.createRootBundle();
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(timestamp.toString());
 bundle.add(value);
}

代码示例来源:origin: org.apache.beam/beam-runners-direct-java

@Test
public void timerUpdateBuilderWithSetPastEndOfTime() {
 Instant timerStamp = BoundedWindow.TIMESTAMP_MAX_VALUE.plus(Duration.standardMinutes(2));
 TimerData tooFar = TimerData.of(StateNamespaces.global(), timerStamp, TimeDomain.EVENT_TIME);
 TimerUpdateBuilder builder = TimerUpdate.builder(StructuralKey.empty());
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(timerStamp.toString());
 builder.setTimer(tooFar);
}

相关文章