INNER CODE UNIT · Java
read
gruelbox/transaction-outbox · transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultInvocationSerializer.java:389
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));
}
@Override
public MonthDay read(JsonReader in) throws IOException {
return MonthDay.parse(in.nextString(), formatter);
}