@@ -50,7 +50,7 @@ private static <T> T castUnsafe(@NotNull final Object o) {
50
50
*
51
51
* @return Created instance
52
52
*/
53
- @ NotNull public static EntityMapper newInstance () {
53
+ public static @ NotNull EntityMapper newInstance () {
54
54
final EntityMapper mapper = new EntityMapper ();
55
55
mapper .registerDeserializer (String .class , new StringDeserializer ());
56
56
mapper .registerSerializer (String .class , new StringSerializer ());
@@ -65,8 +65,8 @@ private static <T> T castUnsafe(@NotNull final Object o) {
65
65
* @param <T> Type to map
66
66
* @return Mapper instance
67
67
*/
68
- @ NotNull public <T > EntityMapper registerSerializer (@ NotNull final Class <T > clazz ,
69
- @ NotNull final EntitySerializer <T > serializer ) {
68
+ public @ NotNull <T > EntityMapper registerSerializer (@ NotNull final Class <T > clazz ,
69
+ @ NotNull final EntitySerializer <T > serializer ) {
70
70
Objects .requireNonNull (clazz , "Class may not be null" );
71
71
Objects .requireNonNull (serializer , "Serializer may not be null" );
72
72
this .serializers .put (clazz , serializer );
@@ -81,7 +81,7 @@ private static <T> T castUnsafe(@NotNull final Object o) {
81
81
* @param <T> Type of the objects produces by the deserializer
82
82
* @return Mapper instance
83
83
*/
84
- @ NotNull public <T > EntityMapper registerDeserializer (@ NotNull final Class <T > clazz ,
84
+ public @ NotNull <T > EntityMapper registerDeserializer (@ NotNull final Class <T > clazz ,
85
85
@ NotNull final EntityDeserializer <T > deserializer ) {
86
86
Objects .requireNonNull (clazz , "Type may not be null" );
87
87
Objects .requireNonNull (deserializer , "Deserializer may not be null" );
@@ -145,7 +145,6 @@ public interface EntitySerializer<T> {
145
145
146
146
}
147
147
148
-
149
148
/**
150
149
* Deserializer for HTTP response bodies
151
150
*
@@ -166,11 +165,10 @@ public interface EntityDeserializer<T> {
166
165
167
166
}
168
167
169
-
170
168
private static final class StringDeserializer implements EntityDeserializer <String > {
171
169
172
- @ NotNull @ Override
173
- public String deserialize (@ Nullable final ContentType contentType ,
170
+ @ Override
171
+ public @ NotNull String deserialize (@ Nullable final ContentType contentType ,
174
172
final byte @ NotNull [] input ) {
175
173
final Charset charset ;
176
174
if (contentType != null && contentType .toString ().toLowerCase ().contains ("utf-8" )) {
@@ -200,5 +198,4 @@ public ContentType getContentType() {
200
198
}
201
199
202
200
}
203
-
204
201
}
0 commit comments