import static java.util.Objects.requireNonNull;
+import java.io.DataInput;
import java.io.Externalizable;
import java.io.IOException;
import java.io.NotSerializableException;
return str;
}
+ public static @NonNull Revision readFrom(final DataInput in) throws IOException {
+ return ofRead(in.readUTF());
+ }
+
+ static @NonNull Revision ofRead(final @NonNull String str) throws IOException {
+ try {
+ return of(str);
+ } catch (DateTimeParseException e) {
+ throw new IOException("Invalid revision-date string", e);
+ }
+ }
+
/**
* Compare two {@link Optional}s wrapping Revisions. Arguments and return value are consistent with
* {@link java.util.Comparator#compare(Object, Object)} interface contract. Missing revisions compare as lower