Java List Single Value singleQuoatanizeStringList(List entries)

Here you can find the source of singleQuoatanizeStringList(List entries)

Description

Place single quotes around the individual entries in a List of Strings

License

Open Source License

Parameter

Parameter Description
entries a parameter

Declaration

public static List<String> singleQuoatanizeStringList(List<String> entries) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Main {
    /**/* ww w  .  j  ava 2  s. co m*/
     * Place single quotes around the individual entries in a List of Strings
     * @param entries
     * @return
     */
    public static List<String> singleQuoatanizeStringList(List<String> entries) {
        List<String> quotedEntries = new ArrayList<String>(entries == null ? 0 : entries.size());

        if (entries != null) {
            for (Iterator<String> iterator = entries.iterator(); iterator.hasNext();) {
                String entry = (String) iterator.next();
                quotedEntries.add("'" + entry + "'");
            }
        }
        return quotedEntries;
    }
}

Related

  1. single(List list)
  2. singleElementList(T element)
  3. singleItemAsList(T item)
  4. singletonList(final T source)
  5. singletonList(T element)
  6. singletonListIfNotNullOrEmptyListIfNull(T element)
  7. singleValue(Class type, List values)