com.greenpepper.runner.StringArrayConverter Maven / Gradle / Ivy
package com.greenpepper.runner;
import com.greenpepper.util.StringUtil;
import com.greenpepper.util.cli.Converter;
/**
* StringArrayConverter class.
*
* @author oaouattara
* @version $Id: $Id
*/
public class StringArrayConverter implements Converter
{
private String separators;
/**
* Constructor for StringArrayConverter.
*
* @param separators a {@link java.lang.String} object.
*/
public StringArrayConverter( String separators )
{
this.separators = separators;
}
/** {@inheritDoc} */
public String[] convert( String value ) throws Exception
{
return StringUtil.isBlank( value ) ? new String[0] : value.split( separators );
}
}