INNER CODE UNIT · Java

write

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

    public void write(JsonWriter out, LocalDate value) throws IOException {
      out.value(DateTimeFormatter.ISO_LOCAL_DATE.format(value));
    }

    @Override
    public LocalDate read(JsonReader in) throws IOException {
      return DateTimeFormatter.ISO_LOCAL_DATE.parse(in.nextString(), LocalDate::from);
    }
  }

  static final class MonthDayTypeAdapter extends TypeAdapter<MonthDay> {

    private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/M");

    @Override
    public void write(JsonWriter out, MonthDay value) throws IOException {
      out.value(value.format(formatter));
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…