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 {
    private static final String DELIMITER = ":";
    private static final String ENTRY_DELIMITER = "=";

    public static String serializerMap(Map<String, String> map) {
        StringBuilder builder = new StringBuilder();

        for (Map.Entry<String, String> entry : map.entrySet()) {
            String key = entry.getKey();
            String val = entry.getValue();
            builder.append(key + ENTRY_DELIMITER + val);
            builder.append(DELIMITER);
        }
        return builder.toString();
    }
}