Class DynamicEnumSet<E extends DynamicEnum<E>>

Type Parameters:
E - key which is of the form K extends DynamicEnum<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>

public class DynamicEnumSet<E extends DynamicEnum<E>> extends LinkedHashSet<E>
A Set<DynamicEnum<E> along the lines of EnumSet.
See Also:
  • Constructor Details

    • DynamicEnumSet

      public DynamicEnumSet()
  • Method Details

    • of

      public static <T extends DynamicEnum<T>> DynamicEnumSet<T> of(T first, T... rest)
      Creates DynamicEnumSet<T>
      Type Parameters:
      T - type of the form T extends DynamicEnum<T>
      Parameters:
      first - argument
      rest - argument
      Returns:
      DynamicEnumSet
    • dynamicEnumSet

      public static <T extends DynamicEnum<T>> DynamicEnumSet<T> dynamicEnumSet(@NonNull @NonNull Class<T> clazz)
      Creates DynamicEnumSet<T>
      Type Parameters:
      T - type of the form T extends DynamicEnum<T>
      Parameters:
      clazz - the class of the dynamic enum for which all stored instances are retrieved
      Returns:
      DynamicEnumSet
    • add

      public boolean add(@NonNull E e)
      .

      Further the element getting added will be checked for the class type

      Specified by:
      add in interface Collection<E extends DynamicEnum<E>>
      Specified by:
      add in interface Set<E extends DynamicEnum<E>>
      Overrides:
      add in class HashSet<E extends DynamicEnum<E>>