Class TypeEnumSet<E extends Enum<E> & TypeEnum>

java.lang.Object
net.okapia.osid.torrefacto.collect.TypeSet
net.okapia.osid.torrefacto.collect.TypeEnumSet<E>
Type Parameters:
E - the element type
All Implemented Interfaces:
Iterable<Type>, Types

public final class TypeEnumSet<E extends Enum<E> & TypeEnum> extends TypeSet implements Types
A TypeSet whose members are drawn from a Java enum. The enum constants implement TypeEnum, each supplying one org.osid.type.Type; the constructor loads every constant's type into the set. getEnum(Type) then maps a type back to the enum constant that carries it. This is the convenient way to expose a fixed, compile-time set of supported types and recover their enum form on lookup.
  • Constructor Details

    • TypeEnumSet

      public TypeEnumSet(Class<E> enumClass)
      Constructs a new TypeEnumSet.
      Parameters:
      enumClass - the enum class whose constants supply the types
      Throws:
      NullArgumentException - enumClass is null
  • Method Details