19
19
import com .google .gson .FieldNamingPolicy ;
20
20
import com .google .gson .Gson ;
21
21
import com .google .gson .LongSerializationPolicy ;
22
+ import org .jspecify .annotations .Nullable ;
22
23
23
24
import org .springframework .boot .context .properties .ConfigurationProperties ;
24
25
@@ -35,150 +36,150 @@ public class GsonProperties {
35
36
* Whether to generate non-executable JSON by prefixing the output with some special
36
37
* text.
37
38
*/
38
- private Boolean generateNonExecutableJson ;
39
+ private @ Nullable Boolean generateNonExecutableJson ;
39
40
40
41
/**
41
42
* Whether to exclude all fields from consideration for serialization or
42
43
* deserialization that do not have the "Expose" annotation.
43
44
*/
44
- private Boolean excludeFieldsWithoutExposeAnnotation ;
45
+ private @ Nullable Boolean excludeFieldsWithoutExposeAnnotation ;
45
46
46
47
/**
47
48
* Whether to serialize null fields.
48
49
*/
49
- private Boolean serializeNulls ;
50
+ private @ Nullable Boolean serializeNulls ;
50
51
51
52
/**
52
53
* Whether to enable serialization of complex map keys (i.e. non-primitives).
53
54
*/
54
- private Boolean enableComplexMapKeySerialization ;
55
+ private @ Nullable Boolean enableComplexMapKeySerialization ;
55
56
56
57
/**
57
58
* Whether to exclude inner classes during serialization.
58
59
*/
59
- private Boolean disableInnerClassSerialization ;
60
+ private @ Nullable Boolean disableInnerClassSerialization ;
60
61
61
62
/**
62
63
* Serialization policy for Long and long types.
63
64
*/
64
- private LongSerializationPolicy longSerializationPolicy ;
65
+ private @ Nullable LongSerializationPolicy longSerializationPolicy ;
65
66
66
67
/**
67
68
* Naming policy that should be applied to an object's field during serialization and
68
69
* deserialization.
69
70
*/
70
- private FieldNamingPolicy fieldNamingPolicy ;
71
+ private @ Nullable FieldNamingPolicy fieldNamingPolicy ;
71
72
72
73
/**
73
74
* Whether to output serialized JSON that fits in a page for pretty printing.
74
75
*/
75
- private Boolean prettyPrinting ;
76
+ private @ Nullable Boolean prettyPrinting ;
76
77
77
78
/**
78
79
* Sets how strictly the RFC 8259 specification will be enforced when reading and
79
80
* writing JSON.
80
81
*/
81
- private Strictness strictness ;
82
+ private @ Nullable Strictness strictness ;
82
83
83
84
/**
84
85
* Whether to disable the escaping of HTML characters such as '<', '>', etc.
85
86
*/
86
- private Boolean disableHtmlEscaping ;
87
+ private @ Nullable Boolean disableHtmlEscaping ;
87
88
88
89
/**
89
90
* Format to use when serializing Date objects.
90
91
*/
91
- private String dateFormat ;
92
+ private @ Nullable String dateFormat ;
92
93
93
- public Boolean getGenerateNonExecutableJson () {
94
+ public @ Nullable Boolean getGenerateNonExecutableJson () {
94
95
return this .generateNonExecutableJson ;
95
96
}
96
97
97
- public void setGenerateNonExecutableJson (Boolean generateNonExecutableJson ) {
98
+ public void setGenerateNonExecutableJson (@ Nullable Boolean generateNonExecutableJson ) {
98
99
this .generateNonExecutableJson = generateNonExecutableJson ;
99
100
}
100
101
101
- public Boolean getExcludeFieldsWithoutExposeAnnotation () {
102
+ public @ Nullable Boolean getExcludeFieldsWithoutExposeAnnotation () {
102
103
return this .excludeFieldsWithoutExposeAnnotation ;
103
104
}
104
105
105
- public void setExcludeFieldsWithoutExposeAnnotation (Boolean excludeFieldsWithoutExposeAnnotation ) {
106
+ public void setExcludeFieldsWithoutExposeAnnotation (@ Nullable Boolean excludeFieldsWithoutExposeAnnotation ) {
106
107
this .excludeFieldsWithoutExposeAnnotation = excludeFieldsWithoutExposeAnnotation ;
107
108
}
108
109
109
- public Boolean getSerializeNulls () {
110
+ public @ Nullable Boolean getSerializeNulls () {
110
111
return this .serializeNulls ;
111
112
}
112
113
113
- public void setSerializeNulls (Boolean serializeNulls ) {
114
+ public void setSerializeNulls (@ Nullable Boolean serializeNulls ) {
114
115
this .serializeNulls = serializeNulls ;
115
116
}
116
117
117
- public Boolean getEnableComplexMapKeySerialization () {
118
+ public @ Nullable Boolean getEnableComplexMapKeySerialization () {
118
119
return this .enableComplexMapKeySerialization ;
119
120
}
120
121
121
- public void setEnableComplexMapKeySerialization (Boolean enableComplexMapKeySerialization ) {
122
+ public void setEnableComplexMapKeySerialization (@ Nullable Boolean enableComplexMapKeySerialization ) {
122
123
this .enableComplexMapKeySerialization = enableComplexMapKeySerialization ;
123
124
}
124
125
125
- public Boolean getDisableInnerClassSerialization () {
126
+ public @ Nullable Boolean getDisableInnerClassSerialization () {
126
127
return this .disableInnerClassSerialization ;
127
128
}
128
129
129
- public void setDisableInnerClassSerialization (Boolean disableInnerClassSerialization ) {
130
+ public void setDisableInnerClassSerialization (@ Nullable Boolean disableInnerClassSerialization ) {
130
131
this .disableInnerClassSerialization = disableInnerClassSerialization ;
131
132
}
132
133
133
- public LongSerializationPolicy getLongSerializationPolicy () {
134
+ public @ Nullable LongSerializationPolicy getLongSerializationPolicy () {
134
135
return this .longSerializationPolicy ;
135
136
}
136
137
137
- public void setLongSerializationPolicy (LongSerializationPolicy longSerializationPolicy ) {
138
+ public void setLongSerializationPolicy (@ Nullable LongSerializationPolicy longSerializationPolicy ) {
138
139
this .longSerializationPolicy = longSerializationPolicy ;
139
140
}
140
141
141
- public FieldNamingPolicy getFieldNamingPolicy () {
142
+ public @ Nullable FieldNamingPolicy getFieldNamingPolicy () {
142
143
return this .fieldNamingPolicy ;
143
144
}
144
145
145
- public void setFieldNamingPolicy (FieldNamingPolicy fieldNamingPolicy ) {
146
+ public void setFieldNamingPolicy (@ Nullable FieldNamingPolicy fieldNamingPolicy ) {
146
147
this .fieldNamingPolicy = fieldNamingPolicy ;
147
148
}
148
149
149
- public Boolean getPrettyPrinting () {
150
+ public @ Nullable Boolean getPrettyPrinting () {
150
151
return this .prettyPrinting ;
151
152
}
152
153
153
- public void setPrettyPrinting (Boolean prettyPrinting ) {
154
+ public void setPrettyPrinting (@ Nullable Boolean prettyPrinting ) {
154
155
this .prettyPrinting = prettyPrinting ;
155
156
}
156
157
157
- public Strictness getStrictness () {
158
+ public @ Nullable Strictness getStrictness () {
158
159
return this .strictness ;
159
160
}
160
161
161
- public void setStrictness (Strictness strictness ) {
162
+ public void setStrictness (@ Nullable Strictness strictness ) {
162
163
this .strictness = strictness ;
163
164
}
164
165
165
- public void setLenient (Boolean lenient ) {
166
+ public void setLenient (@ Nullable Boolean lenient ) {
166
167
setStrictness ((lenient != null && lenient ) ? Strictness .LENIENT : Strictness .STRICT );
167
168
}
168
169
169
- public Boolean getDisableHtmlEscaping () {
170
+ public @ Nullable Boolean getDisableHtmlEscaping () {
170
171
return this .disableHtmlEscaping ;
171
172
}
172
173
173
- public void setDisableHtmlEscaping (Boolean disableHtmlEscaping ) {
174
+ public void setDisableHtmlEscaping (@ Nullable Boolean disableHtmlEscaping ) {
174
175
this .disableHtmlEscaping = disableHtmlEscaping ;
175
176
}
176
177
177
- public String getDateFormat () {
178
+ public @ Nullable String getDateFormat () {
178
179
return this .dateFormat ;
179
180
}
180
181
181
- public void setDateFormat (String dateFormat ) {
182
+ public void setDateFormat (@ Nullable String dateFormat ) {
182
183
this .dateFormat = dateFormat ;
183
184
}
184
185
0 commit comments