Method is used to create a new INSTANCE of the enum validator.

@param enumClass Enum class with the entries to validate for.
@param excludes  Enum entries to exclude from the validator.
@return validator
341213
public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) {
    String[] ex = new String[excludes.length];
    for (int i = 0; i < ex.length; i++) {
      ex[i] = excludes[i].toString();
    }
    return ValidEnum.of(enumClass, ex);
  }
291240
public static final <E extends Enum<E>> E[] createTypeArray(Class<E> c)
   {
      return createTypeArray(c, 0);
   }
1138945
public static <T extends Enum<T>> T getElementValueEnum(AnnotationMirror anno, CharSequence name, Class<T> t, boolean useDefaults) {
        Symbol.VarSymbol vs = getElementValue(anno, name, Symbol.VarSymbol.class, useDefaults);
        T value = Enum.valueOf(t, vs.getSimpleName().toString());
        return value;
    }
403202
public function getEnum(string $enumClass, string $type): array
    {
        $enum = $this->enumList[$enumClass][$type] ?? null;

        if ($enum === null) {
            throw new EnumNotRegisteredException(sprintf('Enum type "%s" not registered.', $enumClass));
        }

        return $enum;
    }
66344
protected <A extends Enum<A>> EnumPath<A> createEnum(String property, Class<A> type) {
        return add(new EnumPath<A>(type, forProperty(property)));
    }
476771
public function createValidator(string $rulesClass): FormValidatorInterface
    {
        /** @var SettingsProviderInterface $settingsProvider */
        $settingsProvider = $this->getContainer()->get(SettingsProviderInterface::class);
        $serializedData   = S::getFormSerializedRules($settingsProvider->get(S::class));

        /** @var FormatterFactoryInterface $factory */
        $factory   = $this->getContainer()->get(FormatterFactoryInterface::class);
        $formatter = $factory->createFormatter(Messages::NAMESPACE_NAME);

        $validator = new FormValidator(
            $rulesClass,
            FormRulesSerializer::class,
            $serializedData,
            new ContextStorage(FormRulesSerializer::readBlocks($serializedData), $this->getContainer()),
            $formatter
        );

        return $validator;
    }
182263
public static <T extends Enum<T> & RichEnum<T>> RichEnumConstants<T> richConstants(Class<T> theClass) {
        return new RichEnumConstants<>(theClass);
    }
1325754
public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) {
		return toEnum(clazz, value, null);
	}
365579
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl,
                                                                     String template, Object... args) {
        return enumTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
    }
235762
public static <E extends Enum<E> & ByteEnum> EnumSet<E> intToSet (Class<E> eclass, int flags)
    {
        EnumSet<E> set = EnumSet.noneOf(eclass);
        for (E value : eclass.getEnumConstants()) {
            if ((flags & toIntFlag(value)) != 0) {
                set.add(value);
            }
        }
        return set;
    }
751202
public <T extends Enum<T>> EnumSet<T> getParametersAsEnums(String name, Class<T> type, EnumSet<T> defaultValue) {
		String[] enumNames = getParameters(name);
		if (enumNames == null) {
			return defaultValue;
		} else {
			Collection<T> enums = new ArrayList<>();
			for (String enumName : enumNames) {
				T enumValue = stringToEnum(blankToNull(enumName), type);
				if (enumValue != null) {
					enums.add(enumValue);
				}
			}
			return enums.isEmpty() ? defaultValue : EnumSet.copyOf(enums);
		}
	}
1206363
public static <E extends Enum<E>> LinkedHashMap<String, E> getEnumMap(final Class<E> enumClass) {
		final LinkedHashMap<String, E> map = new LinkedHashMap<String, E>();
		for (final E e : enumClass.getEnumConstants()) {
			map.put(e.name(), e);
		}
		return map;
	}
668693
private Set<TypeMirror> getExcludedAnnotationTypes(Element element) {
    Optional<AnnotationMirror> maybeAnnotation =
        getAnnotationMirror(element, COPY_ANNOTATIONS_NAME);
    if (!maybeAnnotation.isPresent()) {
      return ImmutableSet.of();
    }

    @SuppressWarnings("unchecked")
    List<AnnotationValue> excludedClasses =
        (List<AnnotationValue>) getAnnotationValue(maybeAnnotation.get(), "exclude").getValue();
    return excludedClasses
        .stream()
        .map(annotationValue -> (DeclaredType) annotationValue.getValue())
        .collect(toCollection(TypeMirrorSet::new));
  }
1275042
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl, String template, List<?> args) {
        return enumTemplate(cl, createTemplate(template), args);
    }
1360017
public Exclude createExclude(Map excludeMap) {
        Exclude exclude = createExclude();
        populateSetSelector(excludeMap, exclude);
        return exclude;
    }
941590
public static <K extends Enum<K> & MultiKeyed> EnumLookup<K, String> of(
    		final Class<K> enumClass, final int idx, final boolean caseSensitive) {
        return new EnumLookup<K, String>(enumClass, idx, caseSensitive);
    }
134957
@Nonnull
  public static <T> EbInterfaceValidator <T> create (@Nonnull final Class <T> aClass)
  {
    return new EbInterfaceValidator <> (aClass);
  }