Java List Create createErrorStringFromList(List errorList)

Here you can find the source of createErrorStringFromList(List errorList)

Description

create Error String From List

License

Open Source License

Declaration

public static String createErrorStringFromList(List<String> errorList) 

Method Source Code

//package com.java2s;
/*// w w  w  . j a  v  a2  s  .c  o m
 * Copyright (c) 2013 IANA. All Rights Reserved. THE AUTHOR MAKES NO
 * REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE
 * AUTHOR SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
 * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

import java.util.List;

public class Main {
    public static String createErrorStringFromList(List<String> errorList) {
        String errorString = "";
        if (errorList != null && errorList.size() > 0) {
            if (errorList.size() == 1) {
                //no need to append <br/> at the end of each string
                errorString = errorList.get(0).toString();
            } else {
                // Append <br/> at the end of each string 
                for (int i = 0; i < errorList.size(); i++) {
                    String str = errorList.get(i).toString() + "<br/>";
                    errorString += str;
                }
            }
        }
        return errorString;
    }
}

Related

  1. createEmptyAdjacencyList(int n)
  2. createEmptyList(Class type)
  3. createEmptyListArray(int size)
  4. createEmptyListOfType(List original, boolean sameSize)
  5. createEntireInStatement(List values)
  6. createGrantScript(List objectsToGrant, String grantee)
  7. createHTMLList(String list, String link, boolean APPEND, String title)
  8. createIfNull(List list)
  9. createIndicesOrderedList(final Collection order, final Collection values)