package com.liquidnet.service.platform.utils;

import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo;
import com.mongodb.BasicDBObject;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;

import java.util.ArrayList;
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 2021/7/21 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<String, String>();
    private static final HashMap<String, Object> hashMapStringAndObject = new HashMap<String, Object>();
    private static final HashMap<String, Integer> hashMapStringAndInteger = new HashMap();
    private static final ArrayList<String> arrayListString = new ArrayList<>();
    private static final LinkedMultiValueMap<String, String> linkedMultiValueMapStringAndString = new LinkedMultiValueMap<String, String>();
    private static final BasicDBObject basicDBObject = new BasicDBObject();

    public static final Object[] objectsArray = new Object[100];
    public static final Integer[] integerArray2 = new Integer[2];

    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> cloneHashMapStringAndObject() {
        return (HashMap<String, Object>) hashMapStringAndObject.clone();
    }

    public static HashMap<String, Integer> cloneHashMapStringAndInteger() {
        return (HashMap<String, Integer>) hashMapStringAndInteger.clone();
    }

    public static ArrayList<String> cloneArrayListString() {
        return (ArrayList<String>) arrayListString.clone();
    }

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

    public static Object[] cloneObjectsArray() {
        return objectsArray.clone();
    }

    public static Integer[] cloneInteger2Array() {
        return integerArray2.clone();
    }

    public static BasicDBObject cloneBasicDBObject() {
        return (BasicDBObject) basicDBObject.clone();
    }
}
