Skip to content

Commit 94dfdfd

Browse files
committed
Update format
1 parent e14c4b4 commit 94dfdfd

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/main/java/dev/subhransu/examples/fasterxmljackson/jsonanygettersetter/JsonAnyGetterSetterExample.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
import org.springframework.web.bind.annotation.RequestBody;
88
import org.springframework.web.bind.annotation.RestController;
99

10-
@RestController
11-
class JsonAnyGetterSetterController {
12-
@PostMapping("/json-any-getter-setter")
13-
public JsonAnyGetterSetterExample anyGetterSetter(@RequestBody JsonAnyGetterSetterExample data) {
14-
return data;
15-
}
16-
}
17-
1810
record JsonAnyGetterSetterExample(String name, Map<String, Object> properties) {
1911
@JsonAnyGetter
2012
public Map<String, Object> getProperties() {
@@ -26,3 +18,11 @@ public void setProperty(String name, Object value) {
2618
properties.put(name, value);
2719
}
2820
}
21+
22+
@RestController
23+
class JsonAnyGetterSetterController {
24+
@PostMapping("/json-any-getter-setter")
25+
public JsonAnyGetterSetterExample anyGetterSetter(@RequestBody JsonAnyGetterSetterExample data) {
26+
return data;
27+
}
28+
}

src/main/java/dev/subhransu/examples/fasterxmljackson/jsonproperty/JsonPropertyExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
import org.springframework.web.bind.annotation.GetMapping;
55
import org.springframework.web.bind.annotation.RestController;
66

7+
record JsonPropertyExample(@JsonProperty("first_name") String firstName) {}
8+
79
@RestController
810
class JsonPropertyExampleController {
911
@GetMapping("/json-property")
1012
public JsonPropertyExample getJsonPropertyExample() {
1113
return new JsonPropertyExample("John Doe");
1214
}
1315
}
14-
15-
record JsonPropertyExample(@JsonProperty("first_name") String firstName) {}

src/main/java/dev/subhransu/examples/fasterxmljackson/jsontypesubtype/Computer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
interface Device {}
1010

11+
record Laptop(String battery) implements Device {}
12+
13+
record Desktop(String monitor) implements Device {}
14+
1115
record Computer<T extends Device>(
1216
@JsonTypeInfo(
1317
use = JsonTypeInfo.Id.NAME,
@@ -19,10 +23,6 @@ record Computer<T extends Device>(
1923
})
2024
T device) {}
2125

22-
record Laptop(String battery) implements Device {}
23-
24-
record Desktop(String monitor) implements Device {}
25-
2626
@RestController
2727
class JsonTypeSubTypeExampleController {
2828
@PostMapping("/json-type")

0 commit comments

Comments
 (0)