forked from OpenAPITools/jackson-databind-nullable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsonNullableModule.java
More file actions
39 lines (31 loc) · 1015 Bytes
/
JsonNullableModule.java
File metadata and controls
39 lines (31 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.openapitools.jackson.nullable;
import tools.jackson.core.Version;
import tools.jackson.core.json.PackageVersion;
import tools.jackson.databind.JacksonModule;
public class JsonNullableModule extends JacksonModule {
private final String NAME = "JsonNullableModule";
@Override
public void setupModule(SetupContext context) {
context.addSerializers(new JsonNullableSerializers());
context.addDeserializers(new JsonNullableDeserializers());
// Modify type info for JsonNullable
context.addTypeModifier(new JsonNullableTypeModifier());
context.addSerializerModifier(new JsonNullableValueSerializerModifier());
}
@Override
public Version version() {
return PackageVersion.VERSION;
}
@Override
public int hashCode() {
return NAME.hashCode();
}
@Override
public boolean equals(Object o) {
return this == o;
}
@Override
public String getModuleName() {
return NAME;
}
}