Java Map Sort sortParams(Map params)

Here you can find the source of sortParams(Map params)

Description

sort Params

License

Apache License

Declaration

public static String sortParams(Map<String, String> params) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.Collections;

import java.util.List;
import java.util.Map;

public class Main {

    public static String sortParams(Map<String, String> params) {

        List<String> values = new ArrayList<String>(params.values());
        Collections.sort(values);

        String prestr = "";

        for (int i = 0; i < values.size(); i++) {
            String value = values.get(i);

            prestr = prestr + value;//from   w w  w .j a  va 2  s .  c  o  m
        }

        return prestr;
    }
}

Related

  1. sortMapByValuesDescending( Map aMap)
  2. sortMapDesc(Map map)
  3. sortMapDescByValue(Map map)
  4. sortMapDescendingByValue(Map unsortedMap)
  5. sortMapUsingComparator(final Map map, final Comparator comparator)
  6. sortSimilarityMapByValue(SortedMap temp)
  7. sortValue(Map toSort, boolean descending, final boolean thenByKey)
  8. sortXLabels(Map xLabels)
  9. toSortedString(Map map)