Class CollectionFactory

java.lang.Object
ru.progrm_jarvis.javacommons.collection.CollectionFactory

public final class CollectionFactory extends Object
Factory used for creation of special collections at classload.
  • Field Details

    • EMPTY_CT_CLASS_ARRAY

      @NotNull public static final @NotNull javassist.CtClass @NotNull @Unmodifiable [] EMPTY_CT_CLASS_ARRAY
      Empty array of CtClasses.
  • Method Details

    • createImmutableEnumSet

      @SafeVarargs @Deprecated @UsesBytecodeModification(value=JAVASSIST, optional=true) public static <E extends Enum<E>> Set<E> createImmutableEnumSet(@NonNull @NonNull E... values)
      Deprecated.
      Creates an immutable enum set from the given array of stored enum constants.
      Type Parameters:
      E - type of enum
      Parameters:
      values - enum constants to be stored in the given set
      Returns:
      runtime-compiled optimized immutable enum set for the given enum values or a pre-compiled n empty set if values is empty
      API note
      at current, the instances are cached and not GC-ed (as their classes) so this should be used carefully, this implementation of immutable enum Sets is specific and should be used carefully instanceof and switch by Enum.ordinal() are used for containment-related checks and