generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unwrapped/nested properties don't work with Builder (#955)
* Unwrapped/nested properties don't work with Builder * graalvm 1.2.4 * Fix unwrapped builder --------- Co-authored-by: Denis Stepanov <denis.s.stepanov@oracle.com>
- Loading branch information
1 parent
9c00389
commit b23e436
Showing
4 changed files
with
111 additions
and
3 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
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
46 changes: 46 additions & 0 deletions
46
serde-jackson-tck/src/main/java/io/micronaut/serde/jackson/builder/introspected/Address.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,46 @@ | ||
package io.micronaut.serde.jackson.builder.introspected; | ||
|
||
import io.micronaut.core.annotation.Introspected; | ||
import io.micronaut.serde.annotation.Serdeable; | ||
|
||
@Serdeable | ||
@Introspected(builder = @Introspected.IntrospectionBuilder(builderClass = Address.Builder.class)) | ||
public class Address { | ||
|
||
private final String city; | ||
|
||
private final String street; | ||
|
||
public Address(String city, String street) { | ||
this.city = city; | ||
this.street = street; | ||
} | ||
|
||
public String getStreet() { | ||
return street; | ||
} | ||
|
||
public String getCity() { | ||
return city; | ||
} | ||
|
||
public static class Builder { | ||
|
||
private String city; | ||
private String street; | ||
|
||
public Builder city(String city) { | ||
this.city = city; | ||
return this; | ||
} | ||
|
||
public Builder street(String street) { | ||
this.street = street; | ||
return this; | ||
} | ||
|
||
public Address build() { | ||
return new Address(city, street); | ||
} | ||
} | ||
} |
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