Returns a {@link Enum} value constant.

@param enumerationDescription The enumeration value to represent.
@return A dynamically resolved enumeration constant.
6238
public static JavaConstant ofEnumeration(EnumerationDescription enumerationDescription) {
            return new Dynamic(new ConstantDynamic(enumerationDescription.getValue(),
                    enumerationDescription.getEnumerationType().getDescriptor(),
                    new Handle(Opcodes.H_INVOKESTATIC,
                            CONSTANT_BOOTSTRAPS,
                            "enumConstant",
                            "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Enum;",
                            false)), enumerationDescription.getEnumerationType());
        }
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;
    }
1043977
public EnumModel findEnumModelByValue(String enumValue) {

        if (enums != null) {
            for (EnumModel enumModel : enums) {
                if (enumValue.equals(enumModel.getValue())) {
                    return enumModel;
                }
            }
        }
        return null;
    }
518702
private static Map<String, Object> getEnumNamesMap(Class<? extends Enum<?>> enumType) {
		final String sourceMethod = "getEnumNameMap"; //$NON-NLS-1$
		final boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod, new Object[]{enumType});
		}
		Map<String, Object> result = new HashMap<String, Object>();
		Enum<?>[] values = enumType.getEnumConstants();
		for (Enum<?> value : values) {
			result.put(value.name(), value);
		}
		if (isTraceLogging) {
			log.exiting(sourceMethod, sourceMethod, result);
		}
		return result;
	}
1170120
protected String ensureFieldDeclarationKeyword(CodeElementExtractor.ElementDescription memberDescription) {
		final List<String> modifiers = getCodeBuilderConfig().getModifiers().get(memberDescription.getName());
		if (modifiers != null && !modifiers.isEmpty()) {
			return modifiers.get(0);
		}
		return getExpressionConfig().getFieldDeclarationKeyword();
	}
800096
public static List<ExtensionConfig> parseEnum(Enumeration<String> valuesEnum) {
        List<ExtensionConfig> configs = new ArrayList<>();

        if (valuesEnum != null) {
            while (valuesEnum.hasMoreElements()) {
                Iterator<String> extTokenIter = QuoteUtil.splitAt(valuesEnum.nextElement(), ",");
                while (extTokenIter.hasNext()) {
                    String extToken = extTokenIter.next();
                    configs.add(ExtensionConfig.parse(extToken));
                }
            }
        }

        return configs;
    }
926328
public static FieldInfo of(Enum<?> enumValue) {
    try {
      FieldInfo result = FieldInfo.of(enumValue.getClass().getField(enumValue.name()));
      Preconditions.checkArgument(
          result != null, "enum constant missing @Value or @NullValue annotation: %s", enumValue);
      return result;
    } catch (NoSuchFieldException e) {
      // not possible
      throw new RuntimeException(e);
    }
  }
165395
def AddEnumDescriptor(self, name, description,
                          enum_values, enum_descriptions):
        """"""
        message = extended_descriptor.ExtendedEnumDescriptor()
        message.name = self.__names.ClassName(name)
        message.description = util.CleanDescription(description)
        self.__DeclareDescriptor(message.name)
        for index, (enum_name, enum_description) in enumerate(
                zip(enum_values, enum_descriptions)):
            enum_value = extended_descriptor.ExtendedEnumValueDescriptor()
            enum_value.name = self.__names.NormalizeEnumName(enum_name)
            if enum_value.name != enum_name:
                message.enum_mappings.append(
                    extended_descriptor.ExtendedEnumDescriptor.JsonEnumMapping(
                        python_name=enum_value.name, json_name=enum_name))
                self.__AddImport('from %s import encoding' %
                                 self.__base_files_package)
            enum_value.number = index
            enum_value.description = util.CleanDescription(
                enum_description or '<no description>')
            message.values.append(enum_value)
        self.__RegisterDescriptor(message)
183402
@SuppressWarnings({ "unchecked", "rawtypes" })
    public Enum<?> findEnumValue(final String enumRef) {
        int sep = enumRef.lastIndexOf('/');
        if (sep == -1) {
            throw new JsiiException("Malformed enum reference: " + enumRef);
        }

        String typeName = enumRef.substring(0, sep);
        String valueName = enumRef.substring(sep + 1);
        try {
            Class klass = resolveJavaClass(typeName);
            return Enum.valueOf(klass, valueName);
        } catch (final ClassNotFoundException e) {
            throw new JsiiException("Unable to resolve enum type " + typeName, e);
        }
    }
884336
public Enumeration getFieldValues(String name,String separators)
    {
        return _header.getValues(name,separators);
    }
476331
def parse_enum_value_definition(lexer: Lexer) -> EnumValueDefinitionNode:
    """"""
    start = lexer.token
    description = parse_description(lexer)
    name = parse_name(lexer)
    directives = parse_directives(lexer, True)
    return EnumValueDefinitionNode(
        description=description, name=name, directives=directives, loc=loc(lexer, start)
    )
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()));
    }
1110459
public static <T extends Enum<?>> String getEnumValuesAsString(Class<T> enumClass) {
		//ScoringStrategy[] vals = ScoringStrategy.values();
		T[] vals = enumClass.getEnumConstants();

		StringBuilder str = new StringBuilder();
		if(vals.length == 1) {
			str.append(vals[0].name());
		} else if(vals.length > 1 ) {
			for(int i=0;i<vals.length-1;i++) {
				str.append(vals[i].name());
				str.append(", ");
			}
			str.append("or ");
			str.append(vals[vals.length-1].name());
		}

		return str.toString();
	}
58576
@Override
    public DescriptionProvider getDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration) {
        return new DescriptionProvider() {
            @Override
            public ModelNode getModelDescription(Locale locale) {
                return description;
            }
        };
    }
445714
public static Matcher enumDefinition() {
    return new Matcher() {
      @Override public boolean matches(Node node, NodeMetadata metadata) {
        JSType jsType = node.getJSType();
        return jsType != null && jsType.isEnumType();
      }
    };
  }
464735
public static <T extends Enum<T>> ConfigurationOptionBuilder<T> enumOption(Class<T> clazz) {
		final ConfigurationOptionBuilder<T> optionBuilder = new ConfigurationOptionBuilder<T>(new EnumValueConverter<T>(clazz), clazz);
		for (T enumConstant : clazz.getEnumConstants()) {
			optionBuilder.addValidOption(enumConstant);
		}
		optionBuilder.sealValidOptions();
		return optionBuilder;
	}
969634
public Object getEnumValue(String name) {
		if (this.kind != Kind.ENUM)
			throw new RuntimeException("getEnumValue(..) can only be called on an enum");
		Object[] vals = getEnumValues();
		if (vals != null) {
			for (Object val : vals) {
				if (((Enum<?>)val).name().equals(name))
					return val;
			}
		}
		return null;
	}