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

org.frgaal.CollectionShims Maven / Gradle / Ivy

There is a newer version: 21.0.0
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.frgaal;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author frgaal
 */
public class CollectionShims {

    @SafeVarargs
    public static  List list(T... values) {
        return Collections.unmodifiableList(Arrays.asList(values.clone()));
    }

    @SafeVarargs
    public static  Set set(T... values) {
        return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(values)));
    }

    public static  Map map() {
        return Collections.emptyMap();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy