Package org.apache.parquet
Class Strings
- java.lang.Object
-
- org.apache.parquet.Strings
-
public final class Strings extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static List<String>
expandGlob(String globPattern)
Expands a string with braces ("{}") into all of its possible permutations.static List<WildcardPath>
expandGlobToWildCardPaths(String globPattern, char delim)
Expands a string according toexpandGlob(String)
, and then constructs aWildcardPath
for each expanded result which can be used to match strings as described inWildcardPath
.static boolean
isNullOrEmpty(String s)
Returns true if s.isEmpty() or s == nullstatic String
join(Iterable<String> s, String on)
Deprecated.static String
join(String[] s, String on)
Deprecated.static String
join(Iterator<String> iter, String on)
Deprecated.
-
-
-
Method Detail
-
join
@Deprecated public static String join(Iterable<String> s, String on)
Deprecated.Join an Iterable of Strings into a single string with a delimiter. For example, join(Arrays.asList("foo","","bar","x"), "|") would return "foo||bar|x"- Parameters:
s
- an iterable of stringson
- the delimiter- Returns:
- a single joined string
-
join
@Deprecated public static String join(Iterator<String> iter, String on)
Deprecated.Join an Iterator of Strings into a single string with a delimiter. For example, join(Arrays.asList("foo","","bar","x"), "|") would return "foo||bar|x"- Parameters:
iter
- an iterator of stringson
- the delimiter- Returns:
- a single joined string
-
join
@Deprecated public static String join(String[] s, String on)
Deprecated.Join an Array of Strings into a single string with a delimiter. For example, join(new String[] {"foo","","bar","x"}, "|") would return "foo||bar|x"- Parameters:
s
- an iterable of stringson
- the delimiter- Returns:
- a single joined string
-
isNullOrEmpty
public static boolean isNullOrEmpty(String s)
Returns true if s.isEmpty() or s == null- Parameters:
s
- a string that may be null or empty- Returns:
- true if the string s is null or is empty
-
expandGlob
public static List<String> expandGlob(String globPattern)
Expands a string with braces ("{}") into all of its possible permutations. We call anything inside of {} braces a "one-of" group. The only special characters in this glob syntax are '}', '{' and ',' The top-level pattern must not contain any commas, but a "one-of" group separates its elements with commas, and a one-of group may contain sub one-of groups. For example: start{a,b,c}end -> startaend, startbend, startcend start{a,{b,c},d} -> startaend, startbend, startcend, startdend {a,b,c} -> a, b, c start{a, b{x,y}} -> starta, startbx, startby- Parameters:
globPattern
- a string in the format described above- Returns:
- a list of all the strings that would satisfy globPattern, including duplicates
-
expandGlobToWildCardPaths
public static List<WildcardPath> expandGlobToWildCardPaths(String globPattern, char delim)
Expands a string according toexpandGlob(String)
, and then constructs aWildcardPath
for each expanded result which can be used to match strings as described inWildcardPath
.- Parameters:
globPattern
- a String to be passed toexpandGlob(String)
delim
- the delimeter used byWildcardPath
- Returns:
- a list of wildcard paths, one for each expanded result
-
-