-
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.
Implement choice of joining strategies
- Loading branch information
1 parent
c17fa0a
commit 1b6702d
Showing
5 changed files
with
133 additions
and
42 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/de/cronn/validation_files_diff/JoiningStrategy.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package de.cronn.validation_files_diff; | ||
|
||
public enum JoiningStrategy { | ||
UNDERSCORE("_"), | ||
DIRECTORY("/"); | ||
|
||
private final String delimiter; | ||
|
||
JoiningStrategy(String delimiter) { | ||
this.delimiter = delimiter; | ||
} | ||
|
||
public String join(String firstString, String secondString) { | ||
if (secondString.startsWith(this.delimiter)) { | ||
return firstString + secondString; | ||
} | ||
|
||
return firstString + this.delimiter + secondString; | ||
} | ||
|
||
} |
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