Here you can find the source of convertToStringList(String valuesCommaSeparated)
Parameter | Description |
---|---|
valuesCommaSeparated | the values comma separated |
public static List<String> convertToStringList(String valuesCommaSeparated)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { /**//ww w.ja v a2s . c o m * Convert a String List. * * @param valuesCommaSeparated the values comma separated * @return the string */ public static List<String> convertToStringList(String valuesCommaSeparated) { List<String> stringValues = new ArrayList<>(); if (valuesCommaSeparated != null) { for (String value : valuesCommaSeparated.split(",")) { if (!isBlank(value)) { stringValues.add(value); } } } return stringValues; } /** * Checks if is blank (null or lenght = 0). * * @param value the value * @return true, if is blank */ public static boolean isBlank(String value) { return value == null || value.trim().isEmpty(); } }