package com.gyt.shr.util;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;


/**
 * 公共工具类
 */
public class commonUtils {

    public static Map<String, Object> createImmutableMap(Object... entries) {
        if (entries.length % 2 != 0) {
            throw new IllegalArgumentException("Entries must be in pairs");
        }
        Map<String, Object> map = new HashMap<>();
        for (int i = 0; i < entries.length; i += 2) {
            map.put((String) entries[i], entries[i + 1]);
        }
        return Collections.unmodifiableMap(map);
    }

}
