Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;

public class Main {
    public static final String LINE_SEP = "\r\n";
    public static final String EQUALS = "=";

    public static String parseFromMap(Map<String, String> mappy) {
        StringBuilder sb = new StringBuilder();

        for (Map.Entry<String, String> e : mappy.entrySet()) {
            if (sb.length() > 0) {
                sb.append(LINE_SEP);
            }
            sb.append(e.getKey()).append(EQUALS).append(e.getValue());
        }

        return sb.toString();
    }
}