package com.liquidnet.service.dragon.utils;

import com.alibaba.fastjson.JSONObject;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.SortedMap;
import java.util.TreeMap;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: ObjectUtil
 * @Package com.liquidnet.service.dragon.utils
 * @Copyright: LightNet @ Copyright (c) 2021
 * @date 2021/7/21 16:00
 */
@Component
public class ObjectUtil {
    public static final LinkedList<Object[]> linkedListObj = new LinkedList<Object[]>();
    public static final LinkedList<String> linkedListStr = new LinkedList<String>();
    public static final HashMap<String, String> hashMapStringAndString = new HashMap<>();
    public static final SortedMap<String, Object> sortedMapStringAndObj = new TreeMap<>();
    public static final AlipayTradeWapPayRequest alipayTradeWapPayRequest = new AlipayTradeWapPayRequest();
    public static final JSONObject jsonObjectObj = new JSONObject();

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

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

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

    public static SortedMap<String, Object> cloneSortedMapStringAndObj() {
        sortedMapStringAndObj.clear();
        return sortedMapStringAndObj;
    }

    public static AlipayTradeWapPayRequest cloneAlipayTradeWapPayRequest() {
        return alipayTradeWapPayRequest;
    }

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