public static Level valueOf(final String name) {
        if (name == null) {
            throw new NullPointerException("No level name given.");
        }
        final String levelName = name.toUpperCase();
        if (levels.containsKey(levelName)) {
            return levels.get(levelName);
        }
        throw new IllegalArgumentException("Unknown level constant [" + levelName + "].");
    }
Return the Level associated with the name.

@param name The name of the Level to return.
@return The Level.
@throws NullPointerException     if the Level name is {@code null}.
@throws IllegalArgumentException if the Level name is not registered.
modules/siddhi-core/src/main/java/io/siddhi/core/util/statistics/metrics/Level.java