-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from millij/boolean-support
Added support for Bean property types :: Boolean and Enums
- Loading branch information
Showing
10 changed files
with
402 additions
and
79 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.github.millij.poi.util; | ||
|
||
import java.util.Objects; | ||
|
||
|
||
/** | ||
* Odd ball String Utilities | ||
* | ||
* @since 3.1.0 | ||
*/ | ||
public final class Strings { | ||
|
||
private Strings() { | ||
super(); | ||
// Utility Class | ||
} | ||
|
||
|
||
// Util Methods | ||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Normalize the string by removing unwanted characters from the String. | ||
* | ||
* @param inStr Input String | ||
* @param replacement Replacement character for the unwanted characters | ||
* | ||
* @return Clean / Normalized String | ||
*/ | ||
public static String normalize(final String inStr, final String replacement) { | ||
// Sanity checks | ||
if (Objects.isNull(inStr)) { | ||
return ""; | ||
} | ||
|
||
// Special characters | ||
final String cleanStr = inStr.replaceAll("–", " ").replaceAll("[-\\[\\]/{}:.,;#%=()*+?\\^$|<>&\"\'\\\\]", " "); | ||
final String normalizedStr = cleanStr.toLowerCase().trim().replaceAll("\\s+", replacement); | ||
|
||
return normalizedStr; | ||
} | ||
|
||
/** | ||
* Normalize the string by replacing unwanted characters from the String with "_". | ||
* | ||
* @param inStr Input String | ||
* | ||
* @return Clean / Normalized String | ||
*/ | ||
public static String normalize(final String inStr) { | ||
return normalize(inStr, "_"); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.