Creates an EnumLookup instance for the multi-keyed enumerate of the given class.
If this is a MultiKeyed<String> enumerate, the finding will happen case-insensitively
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);
    }
688107
public Map<String, Enum<?>> getEnumRenames(Class<?> type) {
        if (type == null) {
            throw new IllegalArgumentException("type must not be null");
        }
        Map<String, Enum<?>> map = enumRenames.get(type);
        if (map == null) {
            return new HashMap<String, Enum<?>>();
        }
        return new HashMap<String, Enum<?>>(map);
    }
433109
public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass)
    {
        return getEnum(key, enumClass, null);
    }
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);
        }
    }
1094406
public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue) {
		return (new GenericEnumConverter<>(clazz)).convert(value, defaultValue);
	}
925780
private Class<?> getKey(Class<?> key)
	{
		Class<?> newKey = lookupMap.get(key);
		if (newKey != null)
			return newKey;

		for (Class<?> c : internalMap.keySet())
		{
			if (c.isAssignableFrom(key))
			{
				lookupMap.put(key, c);
				return c;
			}
		}
		return null;
	}
236468
public static Map<String, Class> buildTypeParamImplLookup(Class theClass) {
        Map<String, Class> lookup = new HashMap<>();
        buildTypeParamImplLookup(theClass, lookup);
        return lookup;
    }
101566
public <T extends Enum<T>> Optional<T> getEnum(String key, Class<T> clazz) {
    return this.get(key).map(value -> asEnumValue(key, value, clazz));
  }
180570
public static <E extends Enum<E>> Trie<E> enumTrie(Class<E> enumClass) {
        final TrieBuilder<E> builder = new TrieBuilder<>();
        for (E value : enumClass.getEnumConstants()) {
            builder.add(value.toString(), value);
        }
        return builder.build();
    }
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));
  }
20261
def bind_inum(column, enum_class, options = {})
      options = { prefix: column }.merge(options)
      options[:prefix] = options[:prefix] ? "#{options[:prefix]}_" : ''

      self.class_eval do
        define_method(column) do
          enum_class.parse(read_attribute(column))
        end

        define_method("#{column}=") do |value|
          enum_class.parse(value).tap do |enum|
            if enum
              write_attribute(column, enum.to_i)
            else
              write_attribute(column, nil)
            end
          end
        end

        enum_class.each do |enum|
          define_method("#{options[:prefix]}#{enum.to_s.underscore}?") do
            enum.eql?(read_attribute(column))
          end
        end
      end
    end
147344
public static <E extends Enum<E>> EnumStringConverter<E> create(Class<E> enumType) {
        return new EnumStringConverter<E>(enumType);
    }
998178
public static <T extends Enum<T>> Pattern createValidationPatternFromEnumType(Class<T> enumType) {

        String regEx = Stream.of(enumType.getEnumConstants())
                .map(Enum::name)
                .collect(Collectors.joining("|", "(?i)", ""));

        //Enum constants may contain $ which needs to be escaped
        regEx = regEx.replace("$", "\\$");
        return Pattern.compile(regEx);
    }
6124
def parse_enum(enum):
    
    docs = enum['comment']
    code = '<span class="k">enum</span> <span class="gs">%s</span> {\n' % enum['name']
    for v in enum["values"]:
        if v['comment']:
            for line in v['comment'].split("\n"):
                code += '    <span class="c1">// %s</span>\n' % line
        code += '    <span class="nv">%s</span>\n' % v['value']
    code += "}"

    return to_section(docs, code)
856119
def do_enum(self, parent=None, ident=0):
        
        # TC_ENUM classDesc newHandle enumConstantName
        enum = JavaEnum()
        _, classdesc = self._read_and_exec_opcode(
            ident=ident + 1,
            expect=(
                self.TC_CLASSDESC,
                self.TC_PROXYCLASSDESC,
                self.TC_NULL,
                self.TC_REFERENCE,
            ),
        )
        enum.classdesc = classdesc
        self._add_reference(enum, ident)
        _, enumConstantName = self._read_and_exec_opcode(
            ident=ident + 1, expect=(self.TC_STRING, self.TC_REFERENCE)
        )
        enum.constant = enumConstantName
        return enum
720970
static Class<?> getKeyTypeFromEnumMap(Object enumMap)
    {
        if(__keyTypeFromEnumMap == null)
        {
            throw new RuntimeException("Could not access (reflection) the private " +
                    "field *keyType* (enumClass) from: class java.util.EnumMap");
        }
        
        try
        {
            return (Class<?>)__keyTypeFromEnumMap.get(enumMap);
        }
        catch (IllegalArgumentException e)
        {
            throw new RuntimeException(e);
        }
        catch (IllegalAccessException e)
        {
            throw new RuntimeException(e);
        }
    }
710991
public AnnotationValueImpl addAnnotationValue(String name, String enumClassName, String enumName) {
        AnnotationValueImpl annotationValue = new AnnotationValueImpl(enumClassName, enumName);

        addAnnotationValue(name, annotationValue);

        return annotationValue;
    }