All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jslsolucoes.jax.rs.client.se.api.impl.Clonables Maven / Gradle / Ivy

There is a newer version: 1.0.32
Show newest version
package com.jslsolucoes.jax.rs.client.se.api.impl;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;

public class Clonables {

    public static  Map clone(Map map) {
	Map newMap = new WeakHashMap<>(map);
	map.clear();
	return newMap;
    }

    public static  List clone(List list) {
	List newElements = new ArrayList<>(list);
	list.clear();
	return newElements;
    }

    public static  Collection clone(Set set) {
	Set newElements = new HashSet(set);
	set.clear();
	return newElements;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy