Skip to content

Commit

Permalink
Regen converters
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Oct 7, 2024
1 parent adc6a4f commit 22be25d
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public String renderJson(DataObjectModel model) {
writer.print("import io.vertx.core.json.JsonArray;\n");
writer.print("import java.time.Instant;\n");
writer.print("import java.time.format.DateTimeFormatter;\n");
writer.print("import java.util.Base64;\n");
writer.print("\n");
writer.print("/**\n");
writer.print(" * Converter and mapper for {@link " + model.getType() + "}.\n");
Expand All @@ -106,10 +105,6 @@ public String renderJson(DataObjectModel model) {
.codeln("public class " + model.getType().getSimpleName() + "Converter {"
).newLine();
if (generate) {
writer.print(
" private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();\n" +
" private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();\n");
writer.print("\n");

genFromJson(visibility, inheritConverter, model, writer);
writer.print("\n");
Expand Down Expand Up @@ -162,8 +157,6 @@ private void genToJson(String visibility, boolean inheritConverter, DataObjectMo
throw new UnsupportedOperationException();
}
genPropToJson(m, match, prop, writer);
} else if (prop.getType().getName().equals("io.vertx.core.buffer.Buffer")) {
genPropToJson("BASE64_ENCODER.encodeToString(", ".getBytes())", prop, writer);
}
} else {
switch (propKind) {
Expand Down Expand Up @@ -292,8 +285,6 @@ private void genFromJson(String visibility, boolean inheritConverter, DataObject
writer
);

} else if (prop.getType().getName().equals("io.vertx.core.buffer.Buffer")) {
genPropFromJson("String", "io.vertx.core.buffer.Buffer.buffer(BASE64_DECODER.decode((String)", "))", prop, writer);
}
} else {
switch (propKind) {
Expand Down

0 comments on commit 22be25d

Please sign in to comment.