Class CollectionFactory
java.lang.Object
ru.progrm_jarvis.javacommons.collection.CollectionFactory
Factory used for creation of special
collections at classload.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull javassist.CtClass @NotNull @Unmodifiable []Empty array ofCtClasses. -
Method Summary
-
Field Details
-
EMPTY_CT_CLASS_ARRAY
@NotNull public static final @NotNull javassist.CtClass @NotNull @Unmodifiable [] EMPTY_CT_CLASS_ARRAYEmpty array ofCtClasses.
-
-
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 enumsetfrom 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
setfor the given enum values or a pre-compiled n empty set ifvaluesis 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 carefullyinstanceofandswitchbyEnum.ordinal()are used for containment-related checks and
-