File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
src/main/java/org/folio/marc4ld/service/ld2marc/mapper/impl/identifier Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 38
38
<apache-commons-collections .version>4.5.0</apache-commons-collections .version>
39
39
40
40
<maven-checkstyle-plugin .version>3.6.0</maven-checkstyle-plugin .version>
41
- <checkstyle .version>10.23.1 </checkstyle .version>
41
+ <checkstyle .version>10.25.0 </checkstyle .version>
42
42
</properties >
43
43
44
44
<dependencies >
Original file line number Diff line number Diff line change @@ -44,11 +44,17 @@ private Optional<Character> getSubfield(Resource resource) {
44
44
.filter (resourceEdge -> resourceEdge .getPredicate () == STATUS )
45
45
.findFirst ()
46
46
.flatMap (e -> getPropertyValue (e .getTarget (), LINK .getValue ()))
47
- .map (link -> switch (link ) {
48
- case CURRENT -> Optional .of (A );
49
- case CANCINV -> Optional .of (Z );
50
- default -> Optional .<Character >empty ();
51
- })
47
+ .map (this ::linkToChar )
52
48
.orElse (Optional .of (A ));
53
49
}
50
+
51
+ private Optional <Character > linkToChar (String link ) {
52
+ if (CURRENT .equals (link )) {
53
+ return Optional .of (A );
54
+ }
55
+ if (CANCINV .equals (link )) {
56
+ return Optional .of (Z );
57
+ }
58
+ return Optional .empty ();
59
+ }
54
60
}
You can’t perform that action at this time.
0 commit comments