Return an instance of the enum constants builder for the given class.

@return an instance of the enum constants builder for the given class.
188413
public AbstractBuilder getEnumConstantsBuilder(ClassWriter classWriter)
            throws Exception {
        return EnumConstantBuilder.getInstance(context, classWriter.getClassDoc(),
            writerFactory.getEnumConstantWriter(classWriter));
    }
142389
public static <E extends Enum<E>> EnumKeyDeserializer<E> newInstance( Class<E> enumClass ) {
        return new EnumKeyDeserializer<E>( enumClass );
    }
707674
public <E extends Enum> E getEnum(HazelcastProperty property, Class<E> enumClazz) {
        String value = getString(property);

        for (E enumConstant : enumClazz.getEnumConstants()) {
            if (enumConstant.name().equalsIgnoreCase(value)) {
                return enumConstant;
            }
        }

        throw new IllegalArgumentException(format("value '%s' for property '%s' is not a valid %s value",
                value, property.getName(), enumClazz.getName()));
    }
456152
@Nullable
  public static <T extends Enum<T>> T getEnumIfPresent(final Class<T> enumClass, final String value)
  {
    Preconditions.checkNotNull(enumClass, "enumClass");
    Preconditions.checkNotNull(value, "value");

    for (T enumValue : enumClass.getEnumConstants()) {
      if (enumValue.name().equals(value)) {
        return enumValue;
      }
    }

    return null;
  }
1338607
public static Object findEnumConstant(Class<?> type, String constantName) {
        return findEnumConstant(type, constantName, true);
    }
79703
@SafeVarargs
    public static <T> Constructor<T> getDeclaredConstructor(final Class<T> cls, final Class<?>... parameterTypes) {
        Map<Class<?>[], Constructor<?>> constructorPool = classDeclaredConstructorPool.get(cls);
        Constructor<T> constructor = null;

        if (constructorPool != null) {
            constructor = (Constructor<T>) constructorPool.get(parameterTypes);
        }

        if (constructor == null) {
            try {
                constructor = cls.getDeclaredConstructor(parameterTypes);

                // SHOULD NOT set it true here.
                // constructor.setAccessible(true);
            } catch (NoSuchMethodException e) {
                // ignore.
            }

            if (constructor != null) {
                if (constructorPool == null) {
                    constructorPool = new ArrayHashMap<>(ConcurrentHashMap.class);
                    classDeclaredConstructorPool.put(cls, constructorPool);
                }

                constructorPool.put(parameterTypes.clone(), constructor);
            }
        }

        return constructor;
    }
147344
public static <E extends Enum<E>> EnumStringConverter<E> create(Class<E> enumType) {
        return new EnumStringConverter<E>(enumType);
    }
694127
public static <T extends Enum<T>> @NonNull NameMap<T> create(final T @NonNull [] constants, final @NonNull Function<T, String> namer) {
    final Map<String, T> byName = new HashMap<>(constants.length);
    final Map<T, String> byValue = new HashMap<>(constants.length);
    for(int i = 0, length = constants.length; i < length; i++) {
      final T constant = constants[i];
      final String name = namer.apply(constant);
      byName.put(name, constant);
      byValue.put(constant, name);
    }
    return new NameMap<>(Collections.unmodifiableMap(byName), Collections.unmodifiableMap(byValue));
  }
1286379
public static <T extends Enum<T>> IAccessor<T> createAccessor(Class<T> clazz) {
        return new EnumNameAccessor<T>(clazz);
    }
92874
public <T extends Enum<T>> ThriftEnumMetadata<?> getThriftEnumMetadata(Class<?> enumClass)
    {
        ThriftEnumMetadata<?> enumMetadata = enums.get(enumClass);
        if (enumMetadata == null) {
            enumMetadata = new ThriftEnumMetadataBuilder<>((Class<T>) enumClass).build();

            ThriftEnumMetadata<?> current = enums.putIfAbsent(enumClass, enumMetadata);
            if (current != null) {
                enumMetadata = current;
            }
        }
        return enumMetadata;
    }
1297573
public static Builder forClass(Class clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("class can not be null");
        }
        return new Builder(Collections.singletonList(clazz));
    }
1172123
private ClassBuilder getClassBuilder(Element element) {
        ClassBuilder classBuilder = new ClassBuilder(messager, element);
        classBuilder.setBindingManager(this);
        return classBuilder;
    }
423483
public static <K extends Enum<K> & MultiKeyed, V> EnumLookup<K, V> of(final Class<K> enumClass, final int idx) {
        return new EnumLookup<K, V>(enumClass, idx, false);
    }
1020597
public static String enumValues(Class<?> enumClass) {
    Preconditions.checkNotNull(enumClass, "enumClass cannot be null");
    Preconditions.checkState(enumClass.isEnum(), "enumClass must be an enum.");
    return Joiner.on(", ").join(enumClass.getEnumConstants());
  }
223536
private static function getReflection(): ReflectionClass
    {
        $class = static::class;

        if (array_key_exists($class, self::$reflections)) {
            return self::$reflections[$class];
        }

        self::$reflections[$class] = $reflection = new ReflectionClass($class);

        $constants = $reflection->getConstants();
        if ([] === $constants) {
            throw new LogicException(sprintf('Class %s must define Constants', static::class));
        }

        foreach ($constants as $value) {
            if (!\is_int($value)) {
                throw new LogicException('All enum constants must be in integer type');
            }
        }

        return $reflection;
    }
297400
Object getInstanceOfClass(Class cls) {
		if (Boolean.class.isAssignableFrom(cls) || Boolean.TYPE.isAssignableFrom(cls)) {
			return Boolean.FALSE;
		} else if (Integer.TYPE.isAssignableFrom(cls) || Short.TYPE.isAssignableFrom(cls) || Integer.class.isAssignableFrom(cls) || Short.class.isAssignableFrom(cls)) {
			return 0;
		} else if (Long.TYPE.isAssignableFrom(cls) || Long.class.isAssignableFrom(cls)) {
			return 0L;
		} else if (Float.TYPE.isAssignableFrom(cls) || Float.class.isAssignableFrom(cls)) {
			return 0.1F;
		} else if (Double.TYPE.isAssignableFrom(cls) || Double.class.isAssignableFrom(cls)) {
			return 0.1D;
		} else if (cls.isArray()) {
			Class<?> comp = cls.getComponentType();
			Object instance = getInstanceOfClass(comp);
			return new Object[]{instance, instance};
		} else {
			try {
				return cls.newInstance();
			} catch (InstantiationException | IllegalAccessException ex) {
				return getObjectFromConstantFields(cls);
			}
		}
	}
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);
		}
	}