Package org.openbase.jul.processing
Class StringProcessor
- java.lang.Object
-
- org.openbase.jul.processing.StringProcessor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringProcessor.Alignment
-
Constructor Summary
Constructors Constructor Description StringProcessor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
fillWithSpaces(String input, int lenght)
Method fills the given input string with width-spaces until the given string length is reached.static String
fillWithSpaces(String input, int lenght, StringProcessor.Alignment textAlignment)
Method fills the given input string with width-spaces until the given string length is reached.static String
formatHumanReadable(String input)
static String
insertSpaceBetweenPascalCase(String input)
static String
removeDoubleWhiteSpaces(String input)
static String
removeWhiteSpaces(String input)
Remove all white spaces (spaces, tabs, ...) from the input string.static String
replaceHyphenWithUnderscore(String input)
static <ENTRY> String
transformCollectionToString(Collection<ENTRY> collection, String separator, Filter<ENTRY>... filters)
Method calls toString on each entry of the given collection and builds a string where each entry is separated by the given separator.static <ENTRY> String
transformCollectionToString(Collection<ENTRY> collection, org.openbase.jul.iface.Transformer<ENTRY,String> transformer, String separator, Filter<ENTRY>... filters)
Method calls toString on each entry of the given collection and builds a string where each entry is separated by the given separator.static String
transformFirstCharToLowerCase(String input)
static String
transformFirstCharToUpperCase(String input)
static String
transformToCamelCase(String input)
static String
transformToIdString(String input)
static String
transformToKebabCase(String input)
static String
transformToNormalizedFileName(String filename)
Method normalizes a string into a simple file name by removing duplicated path limiters.static String
transformToPascalCase(String input)
static String
transformToUpperCase(String input)
static String
transformUpperCaseToPascalCase(String input)
-
-
-
Method Detail
-
removeWhiteSpaces
public static String removeWhiteSpaces(String input)
Remove all white spaces (spaces, tabs, ...) from the input string.- Parameters:
input
- the string from which white spaces are removed.- Returns:
- the input with removed white spaces
-
fillWithSpaces
public static String fillWithSpaces(String input, int lenght)
Method fills the given input string with width-spaces until the given string length is reached.Note: The origin input string will aligned to the left.
- Parameters:
input
- the original input stringlenght
- the requested input string length.- Returns:
- the extended input string
-
fillWithSpaces
public static String fillWithSpaces(String input, int lenght, StringProcessor.Alignment textAlignment)
Method fills the given input string with width-spaces until the given string length is reached.Note: The origin input string will aligned to the left.
- Parameters:
input
- the original input stringlenght
- the requested input string length.textAlignment
- the alignment of the origin input string.- Returns:
- the extended input string
-
transformToNormalizedFileName
public static String transformToNormalizedFileName(String filename)
Method normalizes a string into a simple file name by removing duplicated path limiters.- Parameters:
filename
- the file name origin- Returns:
- the normalized file name.
-
transformCollectionToString
public static <ENTRY> String transformCollectionToString(Collection<ENTRY> collection, String separator, Filter<ENTRY>... filters)
Method calls toString on each entry of the given collection and builds a string where each entry is separated by the given separator.- Parameters:
collection
- the collection to repesent as string.separator
- the separator between each entry.filters
- a set of filters to skip specific entries.- Returns:
- the string representation of the collection.
-
transformCollectionToString
public static <ENTRY> String transformCollectionToString(Collection<ENTRY> collection, org.openbase.jul.iface.Transformer<ENTRY,String> transformer, String separator, Filter<ENTRY>... filters)
Method calls toString on each entry of the given collection and builds a string where each entry is separated by the given separator.- Parameters:
collection
- the collection providing entries to print.transformer
- provides a transformation from an entry to the string representation.separator
- the separator between each entry to use.filters
- a set of filters to skip specific entries.- Returns:
- the string representation of the collection.
-
-