Skip to content

Commit f8cf21f

Browse files
fix(deps): bump com.puppycrawl.tools:checkstyle from 10.23.1 to 10.25.0 (#100)
* fix(deps): bump com.puppycrawl.tools:checkstyle from 10.23.1 to 10.25.0 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.23.1 to 10.25.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-10.23.1...checkstyle-10.25.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-version: 10.25.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix checkstyle violation --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: PBobylev <[email protected]>
1 parent 0c036c1 commit f8cf21f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<apache-commons-collections.version>4.5.0</apache-commons-collections.version>
3939

4040
<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>
4242
</properties>
4343

4444
<dependencies>

src/main/java/org/folio/marc4ld/service/ld2marc/mapper/impl/identifier/AbstractIdentifierMapper.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,17 @@ private Optional<Character> getSubfield(Resource resource) {
4444
.filter(resourceEdge -> resourceEdge.getPredicate() == STATUS)
4545
.findFirst()
4646
.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)
5248
.orElse(Optional.of(A));
5349
}
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+
}
5460
}

0 commit comments

Comments
 (0)