HADOOP-12639. Improve JavaDoc for getTrimmedStrings. (BELUGA BEHR via umamahesh)
(cherry picked from commit ae67c8424c
)
This commit is contained in:
parent
8e5de6cc42
commit
58cc106378
|
@ -356,6 +356,8 @@ Release 2.8.0 - UNRELEASED
|
|||
|
||||
HADOOP-12618. Fix NPE in TestSequenceFile. (Brahma Reddy Battula via umamahesh)
|
||||
|
||||
HADOOP-12639. Improve JavaDoc for getTrimmedStrings. (BELUGA BEHR via umamahesh)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HADOOP-11785. Reduce the number of listStatus operation in distcp
|
||||
|
|
|
@ -399,10 +399,12 @@ public class StringUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Splits a comma separated value <code>String</code>, trimming leading and trailing whitespace on each value.
|
||||
* Duplicate and empty values are removed.
|
||||
* @param str a comma separated <String> with values
|
||||
* @return a <code>Collection</code> of <code>String</code> values
|
||||
* Splits a comma separated value <code>String</code>, trimming leading and
|
||||
* trailing whitespace on each value. Duplicate and empty values are removed.
|
||||
*
|
||||
* @param str a comma separated <String> with values, may be null
|
||||
* @return a <code>Collection</code> of <code>String</code> values, empty
|
||||
* Collection if null String input
|
||||
*/
|
||||
public static Collection<String> getTrimmedStringCollection(String str){
|
||||
Set<String> set = new LinkedHashSet<String>(
|
||||
|
@ -412,9 +414,12 @@ public class StringUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Splits a comma separated value <code>String</code>, trimming leading and trailing whitespace on each value.
|
||||
* @param str a comma separated <String> with values
|
||||
* @return an array of <code>String</code> values
|
||||
* Splits a comma separated value <code>String</code>, trimming leading and
|
||||
* trailing whitespace on each value.
|
||||
*
|
||||
* @param str a comma separated <code>String</code> with values, may be null
|
||||
* @return an array of <code>String</code> values, empty array if null String
|
||||
* input
|
||||
*/
|
||||
public static String[] getTrimmedStrings(String str){
|
||||
if (null == str || str.trim().isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue