Java List Merge mergeIdAndStrings(Long accountId, Long workspaceId, List strs)

Here you can find the source of mergeIdAndStrings(Long accountId, Long workspaceId, List strs)

Description

merge Id And Strings

License

Open Source License

Declaration

public static List<String> mergeIdAndStrings(Long accountId, Long workspaceId, List<String> strs) 

Method Source Code


//package com.java2s;
import java.util.ArrayList;

import java.util.List;

public class Main {

    public static List<String> mergeIdAndStrings(Long accountId, Long workspaceId, List<String> strs) {
        List<String> ps = new ArrayList<>();
        for (String str : strs) {
            ps.add(mergeIdAndString(accountId, workspaceId, str));
        }/*from w ww .  java2 s. co m*/
        return ps;
    }

    public static String[] mergeIdAndStrings(Long accountId, Long workspaceId, String[] strs) {
        String[] ps = new String[strs.length];
        int i = 0;
        for (String str : strs) {
            ps[i] = mergeIdAndString(accountId, workspaceId, str);
            i++;
        }
        return ps;
    }

    public static String mergeIdAndString(Long accountId, Long workspaceId, String str) {
        return new StringBuffer().append(accountId).append("_").append(workspaceId).append("_").append(str)
                .toString();
    }
}

Related

  1. mergeErrorMsgList(List errorMsgs)
  2. mergeException(List t)
  3. mergeExcludedFieldLists(String[] superClassExcludes, String[] localClassExcludes)
  4. mergeFilterLists(List childFilters, List parentFilters)
  5. mergeHierarchicalAndFlatDimensions( Collection> hierachicalDimensions, Collection> flatDimensions)
  6. mergeIntegerResult(List result)
  7. mergeList(List sourceList, List resultList, Set filterSet)
  8. mergeList(List list1, List list2, List... rest)
  9. mergeList(List list1, List list2)