Skip to content

Commit

Permalink
Use @JsonGen annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Nov 30, 2023
1 parent 8f4cf05 commit e56773a
Show file tree
Hide file tree
Showing 42 changed files with 127 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ClusterDescriptionConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ClusterDescription obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ClusterDescription obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "nodes":
Expand Down Expand Up @@ -54,11 +54,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(ClusterDescription obj, JsonObject json) {
static void toJson(ClusterDescription obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ClusterDescription obj, java.util.Map<String, Object> json) {
static void toJson(ClusterDescription obj, java.util.Map<String, Object> json) {
if (obj.getNodes() != null) {
JsonArray array = new JsonArray();
obj.getNodes().forEach(item -> array.add(item.toJson()));
Expand Down
6 changes: 3 additions & 3 deletions src/main/generated/io/vertx/kafka/admin/ConfigConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConfigConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, Config obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, Config obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "entries":
Expand All @@ -34,11 +34,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(Config obj, JsonObject json) {
static void toJson(Config obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(Config obj, java.util.Map<String, Object> json) {
static void toJson(Config obj, java.util.Map<String, Object> json) {
if (obj.getEntries() != null) {
JsonArray array = new JsonArray();
obj.getEntries().forEach(item -> array.add(item.toJson()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConfigEntryConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConfigEntry obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConfigEntry obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "name":
Expand Down Expand Up @@ -64,11 +64,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(ConfigEntry obj, JsonObject json) {
static void toJson(ConfigEntry obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ConfigEntry obj, java.util.Map<String, Object> json) {
static void toJson(ConfigEntry obj, java.util.Map<String, Object> json) {
if (obj.getName() != null) {
json.put("name", obj.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConfigSynonymConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConfigSynonym obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConfigSynonym obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "name":
Expand All @@ -39,11 +39,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(ConfigSynonym obj, JsonObject json) {
static void toJson(ConfigSynonym obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ConfigSynonym obj, java.util.Map<String, Object> json) {
static void toJson(ConfigSynonym obj, java.util.Map<String, Object> json) {
if (obj.getName() != null) {
json.put("name", obj.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConsumerGroupDescriptionConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConsumerGroupDescription obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConsumerGroupDescription obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "groupId":
Expand Down Expand Up @@ -69,11 +69,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(ConsumerGroupDescription obj, JsonObject json) {
static void toJson(ConsumerGroupDescription obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ConsumerGroupDescription obj, java.util.Map<String, Object> json) {
static void toJson(ConsumerGroupDescription obj, java.util.Map<String, Object> json) {
if (obj.getGroupId() != null) {
json.put("groupId", obj.getGroupId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConsumerGroupListingConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConsumerGroupListing obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConsumerGroupListing obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "groupId":
Expand All @@ -34,11 +34,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(ConsumerGroupListing obj, JsonObject json) {
static void toJson(ConsumerGroupListing obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ConsumerGroupListing obj, java.util.Map<String, Object> json) {
static void toJson(ConsumerGroupListing obj, java.util.Map<String, Object> json) {
if (obj.getGroupId() != null) {
json.put("groupId", obj.getGroupId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public class DescribeClusterOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, DescribeClusterOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, DescribeClusterOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
}
}
}

public static void toJson(DescribeClusterOptions obj, JsonObject json) {
static void toJson(DescribeClusterOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(DescribeClusterOptions obj, java.util.Map<String, Object> json) {
static void toJson(DescribeClusterOptions obj, java.util.Map<String, Object> json) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public class DescribeConsumerGroupsOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, DescribeConsumerGroupsOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, DescribeConsumerGroupsOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
}
}
}

public static void toJson(DescribeConsumerGroupsOptions obj, JsonObject json) {
static void toJson(DescribeConsumerGroupsOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(DescribeConsumerGroupsOptions obj, java.util.Map<String, Object> json) {
static void toJson(DescribeConsumerGroupsOptions obj, java.util.Map<String, Object> json) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public class DescribeTopicsOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, DescribeTopicsOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, DescribeTopicsOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
}
}
}

public static void toJson(DescribeTopicsOptions obj, JsonObject json) {
static void toJson(DescribeTopicsOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(DescribeTopicsOptions obj, java.util.Map<String, Object> json) {
static void toJson(DescribeTopicsOptions obj, java.util.Map<String, Object> json) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public class ListConsumerGroupOffsetsOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ListConsumerGroupOffsetsOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ListConsumerGroupOffsetsOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
}
}
}

public static void toJson(ListConsumerGroupOffsetsOptions obj, JsonObject json) {
static void toJson(ListConsumerGroupOffsetsOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ListConsumerGroupOffsetsOptions obj, java.util.Map<String, Object> json) {
static void toJson(ListConsumerGroupOffsetsOptions obj, java.util.Map<String, Object> json) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ListOffsetsResultInfoConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ListOffsetsResultInfo obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ListOffsetsResultInfo obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "offset":
Expand All @@ -39,11 +39,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(ListOffsetsResultInfo obj, JsonObject json) {
static void toJson(ListOffsetsResultInfo obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(ListOffsetsResultInfo obj, java.util.Map<String, Object> json) {
static void toJson(ListOffsetsResultInfo obj, java.util.Map<String, Object> json) {
json.put("offset", obj.getOffset());
json.put("timestamp", obj.getTimestamp());
if (obj.getLeaderEpoch() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MemberAssignmentConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, MemberAssignment obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, MemberAssignment obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "topicPartitions":
Expand All @@ -34,11 +34,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(MemberAssignment obj, JsonObject json) {
static void toJson(MemberAssignment obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(MemberAssignment obj, java.util.Map<String, Object> json) {
static void toJson(MemberAssignment obj, java.util.Map<String, Object> json) {
if (obj.getTopicPartitions() != null) {
JsonArray array = new JsonArray();
obj.getTopicPartitions().forEach(item -> array.add(item.toJson()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MemberDescriptionConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, MemberDescription obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, MemberDescription obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "consumerId":
Expand All @@ -44,11 +44,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(MemberDescription obj, JsonObject json) {
static void toJson(MemberDescription obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(MemberDescription obj, java.util.Map<String, Object> json) {
static void toJson(MemberDescription obj, java.util.Map<String, Object> json) {
if (obj.getConsumerId() != null) {
json.put("consumerId", obj.getConsumerId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class NewPartitionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, NewPartitions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, NewPartitions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "totalCount":
Expand All @@ -29,11 +29,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(NewPartitions obj, JsonObject json) {
static void toJson(NewPartitions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(NewPartitions obj, java.util.Map<String, Object> json) {
static void toJson(NewPartitions obj, java.util.Map<String, Object> json) {
json.put("totalCount", obj.getTotalCount());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class NewTopicConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, NewTopic obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, NewTopic obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "name":
Expand Down Expand Up @@ -49,11 +49,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(NewTopic obj, JsonObject json) {
static void toJson(NewTopic obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(NewTopic obj, java.util.Map<String, Object> json) {
static void toJson(NewTopic obj, java.util.Map<String, Object> json) {
if (obj.getName() != null) {
json.put("name", obj.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class OffsetSpecConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, OffsetSpec obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, OffsetSpec obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "spec":
Expand All @@ -29,11 +29,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(OffsetSpec obj, JsonObject json) {
static void toJson(OffsetSpec obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(OffsetSpec obj, java.util.Map<String, Object> json) {
static void toJson(OffsetSpec obj, java.util.Map<String, Object> json) {
json.put("spec", obj.getSpec());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TopicDescriptionConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, TopicDescription obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, TopicDescription obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "internal":
Expand Down Expand Up @@ -54,11 +54,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(TopicDescription obj, JsonObject json) {
static void toJson(TopicDescription obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(TopicDescription obj, java.util.Map<String, Object> json) {
static void toJson(TopicDescription obj, java.util.Map<String, Object> json) {
json.put("internal", obj.isInternal());
if (obj.getName() != null) {
json.put("name", obj.getName());
Expand Down
Loading

0 comments on commit e56773a

Please sign in to comment.