Android Array to Set Convert setOf(final T... items)

Here you can find the source of setOf(final T... items)

Description

set Of

License

Apache License

Declaration

public static <T> Set<T> setOf(final T... items) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Arrays;

import java.util.Collections;
import java.util.HashSet;

import java.util.Set;

public class Main {
    public static <T> Set<T> setOf(final T... items) {
        return Collections.unmodifiableSet(new HashSet<T>(Arrays
                .asList(items)));//from w  w  w.ja  va2 s .  c o m
    }
}

Related

  1. asSet(T... vals)