-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#943: adopt functional programming style for helper classes
- Loading branch information
1 parent
ddd504d
commit 2a92f6d
Showing
6 changed files
with
86 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
backend/src/main/java/ch/puzzle/okr/security/helper/UrlHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
package ch.puzzle.okr.security.helper; | ||
|
||
import java.util.Optional; | ||
|
||
public class UrlHelper { | ||
|
||
public static String extractTenantFromIssUrl(String issUrl) { | ||
public static Optional<String> extractTenantFromIssUrl(String issUrl) { | ||
if (issUrl == null) | ||
return Optional.empty(); | ||
String[] issUrlParts = issUrl.split("/"); | ||
return issUrlParts[issUrlParts.length - 1]; | ||
String tenant = issUrlParts[issUrlParts.length - 1]; | ||
return Optional.of(tenant); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters