code: public <T extends Enum<T>> Optional<T> getEnum(String key, Class<T> clazz) {
      return this.get(key).map(value -> asEnumValue(key, value, clazz));
    }
docs: Gets the flag value for an enum of the given type, wrapped in an {@link Optional}, which is
  empty if the flag is unset.