package com.liquidnet.service.galaxy.utils;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;

import java.util.HashMap;
import java.util.LinkedList;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: ObjectUtil
 * @Package com.liquidnet.service.dragon.utils
 * @Copyright: LightNet @ Copyright (c) 2021
 * @date 2022/3/15 16:00
 */
@Component
public class ObjectUtil {
    private static final LinkedList<Object[]> linkedListObj = new LinkedList<Object[]>();
    private static final LinkedList<String> linkedListStr = new LinkedList<String>();
    private static final HashMap<String, String> hashMapStringAndString = new HashMap<>();
    private static final HashMap<String, Object> hashMapStringAndObj = new HashMap<>();
    private static final JSONObject jsonObjectObj = new JSONObject();
    private static final LinkedMultiValueMap<String, String> linkedMultiValueMapStringAndString = new LinkedMultiValueMap<String, String>();

    public static LinkedList<Object[]> cloneLinkedListObj() {
        return (LinkedList<Object[]>) linkedListObj.clone();
    }

    public static LinkedList<String> cloneLinkedListStr() {
        return (LinkedList<String>) linkedListStr.clone();
    }

    public static HashMap<String, String> cloneHashMapStringAndString() {
        return (HashMap<String, String>) hashMapStringAndString.clone();
    }

    public static HashMap<String, Object> cloneHashMapStringAndObj() {
        return (HashMap<String, Object>) hashMapStringAndObj.clone();
    }

    public static JSONObject cloneJsonObjectObj() {
        return (JSONObject) jsonObjectObj.clone();
    }

    public static LinkedMultiValueMap<String, String> cloneLinkedMultiValueMapStringAndString() {
        return linkedMultiValueMapStringAndString.clone();
    }
}
