File tree Expand file tree Collapse file tree 4 files changed +27
-27
lines changed
src/main/java/io/avaje/jsonb/generator Expand file tree Collapse file tree 4 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 26
26
<dependency >
27
27
<groupId >io.avaje</groupId >
28
28
<artifactId >avaje-prisms</artifactId >
29
- <version >1.1 </version >
29
+ <version >1.3 </version >
30
30
<optional >true</optional >
31
31
<scope >provided</scope >
32
32
</dependency >
54
54
<path >
55
55
<groupId >io.avaje</groupId >
56
56
<artifactId >avaje-prisms</artifactId >
57
- <version >1.1 </version >
57
+ <version >1.3 </version >
58
58
</path >
59
59
</annotationProcessorPaths >
60
60
</configuration >
Original file line number Diff line number Diff line change 13
13
import java .util .ArrayList ;
14
14
import java .util .Collections ;
15
15
import java .util .List ;
16
- import java .util .Optional ;
17
16
18
17
final class ComponentReader {
19
18
@@ -46,18 +45,18 @@ private void readMetaData(TypeElement moduleType) {
46
45
final FactoryPrism metaDataFactory = FactoryPrism .getInstance (annotationMirror );
47
46
48
47
if (metaData != null ) {
49
- Optional . ofNullable ( metaData . value ()). stream ()
50
- . flatMap ( List :: stream )
51
- .map (TypeMirror ::toString )
52
- .map (this ::adapterNameFromEntry )
53
- .forEach (componentMetaData ::add );
48
+
49
+ metaData . value (). stream ( )
50
+ .map (TypeMirror ::toString )
51
+ .map (this ::adapterNameFromEntry )
52
+ .forEach (componentMetaData ::add );
54
53
55
54
} else if (metaDataFactory != null ) {
56
- Optional . ofNullable ( metaDataFactory . value ()). stream ()
57
- . flatMap ( List :: stream )
58
- .map (TypeMirror ::toString )
59
- .map (this ::adapterNameFromEntry )
60
- .forEach (componentMetaData ::add );
55
+
56
+ metaDataFactory . value (). stream ( )
57
+ .map (TypeMirror ::toString )
58
+ .map (this ::adapterNameFromEntry )
59
+ .forEach (componentMetaData ::add );
61
60
}
62
61
}
63
62
}
Original file line number Diff line number Diff line change @@ -46,19 +46,20 @@ final class FieldReader {
46
46
this .deserialize = ignoreReader .deserialize ();
47
47
48
48
this .propertyName =
49
- Optional .ofNullable (PropertyPrism .getInstanceOn (element ))
50
- .map (PropertyPrism ::value )
51
- .filter (Objects ::nonNull )
52
- .map (Util ::escapeQuotes )
53
- .orElse (namingConvention .from (fieldName ));
49
+ PropertyPrism .getOptionalOn (element )
50
+ .map (PropertyPrism ::value )
51
+ .filter (Objects ::nonNull )
52
+ .map (Util ::escapeQuotes )
53
+ .orElse (namingConvention .from (fieldName ));
54
+
54
55
this .aliases =
55
- Optional . ofNullable ( JsonAliasPrism .getInstanceOn (element ) )
56
- .map (JsonAliasPrism ::value )
57
- .filter (Objects ::nonNull )
58
- .stream ()
59
- .flatMap (List ::stream )
60
- .map (Util ::escapeQuotes )
61
- .collect (Collectors .toList ());
56
+ JsonAliasPrism .getOptionalOn (element )
57
+ .map (JsonAliasPrism ::value )
58
+ .filter (Objects ::nonNull )
59
+ .stream ()
60
+ .flatMap (List ::stream )
61
+ .map (Util ::escapeQuotes )
62
+ .collect (Collectors .toList ());
62
63
63
64
if (raw ) {
64
65
genericType = GenericType .parse ("java.lang.String" );
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public String toString() {
18
18
19
19
TypeSubTypeMeta (SubTypePrism prism ) {
20
20
type = prism .type ().toString ();
21
- name = Optional . of ( Util .escapeQuotes (prism .name ())). filter ( s -> s . length () > 0 ). orElse ( null );
21
+ name = Util .escapeQuotes (prism .name ());
22
22
}
23
23
24
24
void setElement (TypeElement element ) {
@@ -34,7 +34,7 @@ String type() {
34
34
}
35
35
36
36
String name () {
37
- if (name == null ) {
37
+ if (name . isBlank () ) {
38
38
name = Util .shortName (type );
39
39
}
40
40
return name ;
You can’t perform that action at this time.
0 commit comments