Java Collection Add addPrefix(Collection values, String prefix)

Here you can find the source of addPrefix(Collection values, String prefix)

Description

add Prefix

License

Open Source License

Declaration

public static Collection<String> addPrefix(Collection<String> values, String prefix) 

Method Source Code

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

import java.util.ArrayList;

import java.util.Collection;

public class Main {
    public static Collection<String> addPrefix(Collection<String> values, String prefix) {
        Collection<String> newValues = new ArrayList<String>();

        for (String value : values) {
            newValues.add(prefix + value);
        }//from   w w  w.j ava2 s.  c om

        return newValues;
    }
}

Related

  1. addNonNull(Object element, Collection result)
  2. addNonnullIfMissing(Collection collection, T element)
  3. addNonNulls(Collection c, X... xl)
  4. addNotNull(Collection col, String toAdd)
  5. addOneValueUNSAFE(Collection cloneCollection, Object v)
  6. addPreviousTags(int index, String[] prevTags, int prevTagsToAdd, Collection targetCol)
  7. addRange(Collection c, int start, int to, int step)
  8. addSafe(final Collection collection, T element)
  9. addTo(Collection l, Object... os)