File tree Expand file tree Collapse file tree
java/src/main/java/io/cucumber/messages/ndjson Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
88## [ Unreleased]
9+ ### Fixed
10+ - Improved Javadoc
911
1012## [ 0.2.0] - 2026-01-12
1113### Added
Original file line number Diff line number Diff line change 77
88import static java .util .Objects .requireNonNull ;
99
10+ /**
11+ * Deserializes a JSON string to a message.
12+ */
1013public final class Deserializer implements NdjsonToMessageIterable .Deserializer {
1114
1215 /**
13- * Reads the given {@code json} and converts it to a link {@link Envelope}
16+ * Deserialize a JSON string to message.
17+ *
18+ * <ul>
19+ * <li>Values must be included unless their value is {@code null}
20+ * or an "absent" reference values such as empty optionals.
21+ * <li>Enums must be read as strings.
22+ * <li>Unknown properties must be ignored.
23+ * </ul>
24+ *
25+ * @param json to deserialize
26+ * @return a deserialized {@link Envelope} or null
27+ * @throws IOException if anything goes wrong
1428 */
1529 @ Override
1630 public Envelope readValue (String json ) throws IOException {
Original file line number Diff line number Diff line change 66import java .io .IOException ;
77import java .io .Writer ;
88
9+ /**
10+ * Serializes a message to a single line of JSON.
11+ */
912public final class Serializer implements MessageToNdjsonWriter .Serializer {
1013
1114 /**
12- * Converts a given {@link Envelope} to single line of JSON and writes it
13- * to the given writer.
15+ * Serialize a message to single line of JSON and write it to the
16+ * given {@code writer}.
17+ *
18+ * <ul>
19+ * <li>Values must be included unless their value is {@code null}
20+ * or an "absent" reference values such as empty optionals.
21+ * <li>Enums must be written as strings.
22+ * <li>Implementations may not close the {@code writer} after
23+ * writing a {@code value}.
24+ * </ul>
25+ *
26+ * @param writer to write to
27+ * @param value to serialize
28+ * @throws IOException if anything goes wrong
1429 */
1530 @ Override
1631 public void writeValue (Writer writer , Envelope value ) throws IOException {
You can’t perform that action at this time.
0 commit comments