Returns the value coresponding to the given enum name.
180755
def Value(self, name):
    """"""
    if name in self._enum_type.values_by_name:
      return self._enum_type.values_by_name[name].number
    raise ValueError('Enum %s has no value defined for name %s' % (
        self._enum_type.name, name))
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);
        }
    }
424684
public static function getNameValue($name)
    {
        static::initialize();

        if (!static::isValidName($name)) {
            throw new \InvalidArgumentException(sprintf(
                'The enum name "%s" is not valid. Expected one of: %s',
                $name,
                implode(', ', static::names())
            ));
        }

        return static::$constants[static::$lcKeyMap[strtolower($name)]];
    }
234301
public static ResourceKey key(Class<?> clazz, Enum<?> value) {
        return new ResourceKey(clazz.getName(), value.name());
    }
352879
public long getLongValue(Enum key) {
    if (this._task.get(key) == null) {
      return (long)0;
    }
    else {
      return Long.parseLong(this._task.get(key));
    }
  }
518767
def GetValueByName(self, name):
    
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if not self._registry_key:
      return None

    return self._registry_key.GetValueByName(name)
1084056
def get_enum_from_canonical_name(self, enum_name):
        
        return next((e for e in self.enums if e.canonical_name == enum_name), None)
875103
public function getValues( $name )
    {
        if( !isset( $this->enums[$name] ) ) {
            throw new UnknownEnumException($name);
        }
        return $this->enums[$name];
    }
1190037
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Parameter(key)
        if key not in Parameter._member_map_:
            extend_enum(Parameter, key, default)
        return Parameter[key]
659718
def encode(self, name, as_map_key=False):
        """"""
        if name in self.key_to_value:
            return self.key_to_value[name]
        return self.encache(name) if is_cacheable(name, as_map_key) else name
1014732
private Object getEnumValue(EnumValueDescriptor enumDesc) {
    if (enumSerialization == EnumSerialization.NAME) {
      return getCustSerializedEnumValue(enumDesc.getOptions(), enumDesc.getName());
    } else {
      return enumDesc.getNumber();
    }
  }
782901
public <T extends Enum<T>> T getParameterAsEnum(String name, Class<T> type, T defaultValue) {
		return defaultValue(stringToEnum(getParameter(name), type), defaultValue);
	}
904636
public EnumConstant constant(String name) {
    for (EnumConstant constant : constants()) {
      if (constant.name().equals(name)) {
        return constant;
      }
    }
    return null;
  }
859599
def get_enum_from_name(self, enum_name):
        
        return next((e for e in self.enums if e.name == enum_name), None)
50809
public <T extends Enum<T>> T getEnum(Class<T> enumType, String key) {
    if (enumType == null) {
      throw new IllegalArgumentException("enumType may not be null");
    }
    Object value = get(key);
    if (enumType.isInstance(value)) {
      //noinspection unchecked
      return (T) value;
    } else if (value instanceof String) {
      String stringValue = (String) value;
      return Enum.valueOf(enumType, stringValue);
    }
    return null;
  }
329530
def value(self):
        
        if self._enum and issubclass(self._enum, Enumeration):
            name = self._enum.get_name(self._value)
            if name:
                return name
        return self._value
945689
@SuppressWarnings("unchecked")
	public static <T extends IKeyEnum> T getValue(final int pKey, final Class<T> pClass) {
		for (IKeyEnum val : pClass.getEnumConstants()) {
			if (val.getKey() == pKey) {
				return (T) val;
			}
		}
		LOGGER.error("Unknow value:" + pKey + " for Enum:" + pClass.getName());
		return null;
	}