INNER CODE UNIT · Java

read

gruelbox/transaction-outbox · transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultInvocationSerializer.java:363

    public Instant read(JsonReader in) throws IOException {
      return DateTimeFormatter.ISO_INSTANT.parse(in.nextString(), Instant::from);
    }
  }

  static final class DurationTypeAdapter extends TypeAdapter<Duration> {

    @Override
    public void write(JsonWriter out, Duration value) throws IOException {
      out.value(value.get(ChronoUnit.SECONDS));
    }

    @Override
    public Duration read(JsonReader in) throws IOException {
      return Duration.of(in.nextLong(), ChronoUnit.SECONDS);
    }
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…