Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Main {
    public static List<NameValuePair> convertParametersToNameValuePairs(final Map<String, String> pParameters) {
        final List<NameValuePair> result = new ArrayList<NameValuePair>();

        for (final Entry<String, String> entry : pParameters.entrySet()) {
            result.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
        }

        return result;
    }
}