copyOf

fun <E : Enum<E>> copyOf(s: EnumSet<E>): EnumSet<E>

Creates an enum set with the same element type as the specified enum set, initially containing the same elements (if any).

Return

A copy of the specified enum set.

Parameters

The class of the elements in the set
s

the enum set from which to initialize this enum set

Throws


inline fun <E : Enum<E>> copyOf(c: MutableCollection<E>): EnumSet<E>

Creates an enum set initialized from the specified collection. If the specified collection is an EnumSet instance, this static factory method behaves identically to .copyOf. Otherwise, the specified collection must contain at least one element (in order to determine the new enum set's element type).

Return

An enum set initialized from the given collection.

Parameters

The class of the elements in the collection
c

the collection from which to initialize this enum set

Throws

if c is not an EnumSet instance and contains no elements