-
Notifications
You must be signed in to change notification settings - Fork 93
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
111 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...rated/io/vertx/test/codegen/converter/DataObjectPropertyFormattedDataObjectConverter.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,49 @@ | ||
package io.vertx.test.codegen.converter; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.core.json.JsonArray; | ||
import io.vertx.core.json.impl.JsonUtil; | ||
import java.time.Instant; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.Base64; | ||
|
||
/** | ||
* Converter and mapper for {@link io.vertx.test.codegen.converter.DataObjectPropertyFormattedDataObject}. | ||
* NOTE: This class has been automatically generated from the {@link io.vertx.test.codegen.converter.DataObjectPropertyFormattedDataObject} original class using Vert.x codegen. | ||
*/ | ||
public class DataObjectPropertyFormattedDataObjectConverter { | ||
|
||
|
||
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, DataObjectPropertyFormattedDataObject obj) { | ||
for (java.util.Map.Entry<String, Object> member : json) { | ||
switch (member.getKey()) { | ||
case "id": | ||
if (member.getValue() instanceof String) { | ||
obj.setId((String)member.getValue()); | ||
} | ||
break; | ||
case ":ref": | ||
if (member.getValue() instanceof String) { | ||
obj.setRef((String)member.getValue()); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
|
||
public static void toJson(DataObjectPropertyFormattedDataObject obj, JsonObject json) { | ||
toJson(obj, json.getMap()); | ||
} | ||
|
||
public static void toJson(DataObjectPropertyFormattedDataObject obj, java.util.Map<String, Object> json) { | ||
if (obj.getId() != null) { | ||
json.put("id", obj.getId()); | ||
} | ||
if (obj.getRef() != null) { | ||
json.put(":ref", obj.getRef()); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...onverters/java/io/vertx/test/codegen/converter/DataObjectPropertyFormattedDataObject.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,47 @@ | ||
/* | ||
* Copyright (c) 2011-2017 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
*/ | ||
|
||
package io.vertx.test.codegen.converter; | ||
|
||
import io.vertx.codegen.annotations.DataObject; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
@DataObject(generateConverter = true) | ||
public class DataObjectPropertyFormattedDataObject { | ||
|
||
private String id; | ||
private String ref; | ||
|
||
public DataObjectPropertyFormattedDataObject() { | ||
} | ||
|
||
public DataObjectPropertyFormattedDataObject(JsonObject json) { | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public DataObjectPropertyFormattedDataObject setId(String id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
@DataObject.Property(":ref") | ||
public String getRef() { | ||
return ref; | ||
} | ||
|
||
public DataObjectPropertyFormattedDataObject setRef(String ref) { | ||
this.ref = ref; | ||
return this; | ||
} | ||
} |
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