Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param path nodes to walk in map
@return value
331013
public static <T> Optional<Optional<T>> getOptional(final Map map, final Class<T> clazz, final Object... path) {
        return get(map, Optional.class, path).map(opt -> (Optional<T>) opt);
    }
795327
public static URL getURL(String path, Class<?> clazz) {
		return ResourceUtil.getResource(path, clazz);
	}
247591
public static Optional<List<? extends Config>> getConfigListOptional(Config config,
            String path) {
        return Optional.ofNullable(getConfigList(config, path));
    }
646000
public T get(@Nullable Map<FindOption<?>, ?> options) {
        if (options == null) {
            return defaultValue();
        }

        @SuppressWarnings("unchecked")
        final T value = (T) options.get(this);
        if (value == null) {
            return defaultValue();
        }

        return value;
    }
218067
public static <T> T getUnsafe(final Map map, final Class<T> clazz, final Object... path) {
        return get(map, clazz, path).orElseThrow(() -> new IllegalAccessError(
            "Map "
            + map
            + " does not have value of type "
            + clazz.getName()
            + " by "
            + Arrays.stream(path).map(Object::toString).collect(Collectors.joining(".")))
        );
    }
1006903
public static <T> Optional<List<T>> getList(final Map map, final Class<T> clazz, final Object... path) {
        return get(map, List.class, path).map(c -> (List<T>) c);
    }
1234363
public static File resolve(Class<?> clazz, String path)
    {
        URL url = clazz.getResource(path);
        if (url == null)
        {
            return null;
        }

        File result;
        try
        {
            result = Paths.get(url.toURI()).toFile();
        }
        catch (URISyntaxException ex)
        {
            return null;
        }

        return result;
    }
514445
public static <T> Optional<List<T>> getList(final List list, final Class<T> clazz, final Integer... path) {
        return get(list, List.class, path).map(c -> (List<T>) c);
    }
591008
public static Optional<Object> get(final List list, final Integer... path) {
        return get(list, Object.class, path);
    }
1099479
public <T> Optional<T> getDataAttrOptional(String dPath, Class<T> clazz) {
        return Optional.ofNullable(getDataAttr(dPath, clazz));
    }
745492
@SuppressWarnings("unchecked")
    public static <T> T getObject(Config config, String path, Class<T> clazz) {
        Object obj = getObject(config, path);
        return obj != null && clazz.isAssignableFrom(obj.getClass()) ? (T) obj : null;
    }
665046
public Optional<Path> getPath(String key) {
        Optional<String> property = getString(key);
        if (property.isPresent()) {
            return Optional.of(Paths.get(property.get()));
        } else {
            return Optional.empty();
        }
    }
193002
public static <T> Optional<T> dotGet(final Map map, final Class<T> clazz, final String pathString) {
        if (pathString == null || pathString.isEmpty()) {
            throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED);
        }
        if (!pathString.contains(SEPARATOR)) {
            return Optional.ofNullable((T) map.get(pathString));
        }
        final Object[] path = pathString.split(SEPARATOR_REGEX);
        return MapApi.get(map, clazz, path);
    }
201683
public boolean hasPath(String path) {
        Props props = pathMap.get(path);
        return props != null && !props.isEmpty();
    }
660147
public static Optional<ConfigValue> getValueOptional(Config config, String path) {
        return Optional.ofNullable(getValue(config, path));
    }
196303
public static Optional<String> getString(final List list, final Integer... path) {
        return get(list, String.class, path);
    }
1239604
public Optional<URL> getResource(String path) {
        boolean isDirectory = isDirectory(path);

        if (!isDirectory) {
            URL url = classLoader.getResource(prefixPath(path));
            return Optional.ofNullable(url);
        }
        return Optional.empty();
    }