Skip to content

Commit

Permalink
Add some convenience methods supporting java.util.Optional (#7)
Browse files Browse the repository at this point in the history
Fix #5

Pull request: #7
  • Loading branch information
lefou authored May 30, 2024
1 parent 14db82e commit eb473c5
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 201 deletions.
4 changes: 4 additions & 0 deletions src/main/java/de/tototec/utils/functional/FList.java
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ public static String mkString(final Iterable<?> source, final String separator)
return mkString(source, null, separator, null);
}

public static String mkString(final java.util.Optional<?> source, final String separator) {
return mkString(Optional.fromJava(source), null, separator, null);
}

public static String mkString(final Object[] source, final String separator) {
return mkString(Arrays.asList(source), separator);
}
Expand Down
Loading

0 comments on commit eb473c5

Please sign in to comment.