Example usage for org.apache.hadoop.util StringUtils getTrimmedStringCollection

List of usage examples for org.apache.hadoop.util StringUtils getTrimmedStringCollection

Introduction

In this page you can find the example usage for org.apache.hadoop.util StringUtils getTrimmedStringCollection.

Prototype

public static Collection<String> getTrimmedStringCollection(String str) 

Source Link

Document

Splits a comma separated value String, trimming leading and trailing whitespace on each value.

Usage

From source file:co.cask.tigon.conf.Configuration.java

License:Apache License

/**
 * Get the comma delimited values of the <code>name</code> property as
 * a collection of <code>String</code>s, trimmed of the leading and trailing whitespace.
 * If no such property is specified then empty <code>Collection</code> is returned.
 *
 * @param name property name./*  www . j  a v a2  s .c om*/
 * @return property value as a collection of <code>String</code>s, or empty <code>Collection</code>
 */
public Collection<String> getTrimmedStringCollection(String name) {
    String valueString = get(name);
    if (null == valueString) {
        Collection<String> empty = new ArrayList<String>();
        return empty;
    }
    return StringUtils.getTrimmedStringCollection(valueString);
}