-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
145 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/generated/io/vertx/ext/bridge/BridgeOptionsConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.vertx.ext.bridge; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.core.json.JsonArray; | ||
import java.time.Instant; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.Base64; | ||
|
||
/** | ||
* Converter and mapper for {@link io.vertx.ext.bridge.BridgeOptions}. | ||
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.bridge.BridgeOptions} original class using Vert.x codegen. | ||
*/ | ||
public class BridgeOptionsConverter { | ||
|
||
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder(); | ||
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding(); | ||
|
||
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, BridgeOptions obj) { | ||
for (java.util.Map.Entry<String, Object> member : json) { | ||
switch (member.getKey()) { | ||
case "inboundPermitteds": | ||
if (member.getValue() instanceof JsonArray) { | ||
java.util.ArrayList<io.vertx.ext.bridge.PermittedOptions> list = new java.util.ArrayList<>(); | ||
((Iterable<Object>)member.getValue()).forEach( item -> { | ||
if (item instanceof JsonObject) | ||
list.add(new io.vertx.ext.bridge.PermittedOptions((io.vertx.core.json.JsonObject)item)); | ||
}); | ||
obj.setInboundPermitteds(list); | ||
} | ||
break; | ||
case "outboundPermitteds": | ||
if (member.getValue() instanceof JsonArray) { | ||
java.util.ArrayList<io.vertx.ext.bridge.PermittedOptions> list = new java.util.ArrayList<>(); | ||
((Iterable<Object>)member.getValue()).forEach( item -> { | ||
if (item instanceof JsonObject) | ||
list.add(new io.vertx.ext.bridge.PermittedOptions((io.vertx.core.json.JsonObject)item)); | ||
}); | ||
obj.setOutboundPermitteds(list); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
|
||
static void toJson(BridgeOptions obj, JsonObject json) { | ||
toJson(obj, json.getMap()); | ||
} | ||
|
||
static void toJson(BridgeOptions obj, java.util.Map<String, Object> json) { | ||
if (obj.getInboundPermitteds() != null) { | ||
JsonArray array = new JsonArray(); | ||
obj.getInboundPermitteds().forEach(item -> array.add(item.toJson())); | ||
json.put("inboundPermitteds", array); | ||
} | ||
if (obj.getOutboundPermitteds() != null) { | ||
JsonArray array = new JsonArray(); | ||
obj.getOutboundPermitteds().forEach(item -> array.add(item.toJson())); | ||
json.put("outboundPermitteds", array); | ||
} | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/main/generated/io/vertx/ext/bridge/PermittedOptionsConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package io.vertx.ext.bridge; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.core.json.JsonArray; | ||
import java.time.Instant; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.Base64; | ||
|
||
/** | ||
* Converter and mapper for {@link io.vertx.ext.bridge.PermittedOptions}. | ||
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.bridge.PermittedOptions} original class using Vert.x codegen. | ||
*/ | ||
public class PermittedOptionsConverter { | ||
|
||
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder(); | ||
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding(); | ||
|
||
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, PermittedOptions obj) { | ||
for (java.util.Map.Entry<String, Object> member : json) { | ||
switch (member.getKey()) { | ||
case "address": | ||
if (member.getValue() instanceof String) { | ||
obj.setAddress((String)member.getValue()); | ||
} | ||
break; | ||
case "addressRegex": | ||
if (member.getValue() instanceof String) { | ||
obj.setAddressRegex((String)member.getValue()); | ||
} | ||
break; | ||
case "match": | ||
if (member.getValue() instanceof JsonObject) { | ||
obj.setMatch(((JsonObject)member.getValue()).copy()); | ||
} | ||
break; | ||
case "requiredAuthority": | ||
if (member.getValue() instanceof String) { | ||
obj.setRequiredAuthority((String)member.getValue()); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
|
||
static void toJson(PermittedOptions obj, JsonObject json) { | ||
toJson(obj, json.getMap()); | ||
} | ||
|
||
static void toJson(PermittedOptions obj, java.util.Map<String, Object> json) { | ||
if (obj.getAddress() != null) { | ||
json.put("address", obj.getAddress()); | ||
} | ||
if (obj.getAddressRegex() != null) { | ||
json.put("addressRegex", obj.getAddressRegex()); | ||
} | ||
if (obj.getMatch() != null) { | ||
json.put("match", obj.getMatch()); | ||
} | ||
if (obj.getRequiredAuthority() != null) { | ||
json.put("requiredAuthority", obj.getRequiredAuthority()); | ||
} | ||
} | ||
} |