package com.liquidnet.service.order.utils;

import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
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;
import java.util.List;

/**
 * @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<String, String>();
    public static final HashMap<String, Object> hashMapStringAndObject = new HashMap<String, Object>();
    public static final List<AdamEntersVo> arrayListObject = new ArrayList<>();
    public static final LinkedMultiValueMap<String, String> linkedMultiValueMapStringAndString = new LinkedMultiValueMap<String, String>();
    public static final BasicDBObject basicDBObject = new BasicDBObject();

    public static final Object[] objectsArray = new Object[100];

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

    public static List<AdamEntersVo> cloneArrayListObject() {
        arrayListObject.clear();
        return arrayListObject;
    }

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

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

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