/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.jsendnsca;

/**
 * The level of the passive check
 * 
 * @author Raj Patel
 */
public enum Level {

    /**
     * OK
     */
    OK,
    /**
     * Warning
     */
    WARNING,
    /**
     * Critical
     */
    CRITICAL,
    /**
     * Unknown
     */
    UNKNOWN;

    /**
     * Get the {@link Level} equaivalent of the string level provided ignoring
     * case and leading or trailing whitespace
     * 
     * @param level
     *            the string level
     * @return the level
     */
    public static Level tolevel(String level) {
        try {
            return Level.valueOf(level.toUpperCase().trim());
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException(String.format("[%s] is not valid level", level));
        }
    }

    /**
     * Get the {@link Level} equaivalent of the int levelValue provided
     * 
     * @param levelValue
     *            the integer level value
     * @return the level
     */
    public static Level toLevel(int levelValue) {
        for (Level level : Level.values()) {
            if (level.ordinal() == levelValue) {
                return level;
            }
        }
        throw new IllegalArgumentException(String.format("LevelValue [%s] is not a valid level", levelValue));
    }
}

@@ -630,17 +630,16 @@
 check%0A *
- 
 %0A * @aut
@@ -878,33 +878,32 @@
 @link Level%7D equ
-a
 ivalent of the s
@@ -981,25 +981,24 @@
 space%0A     *
- 
 %0A     * @par
@@ -1399,17 +1399,16 @@
 vel%7D equ
-a
 ivalent 
@@ -1444,17 +1444,16 @@
 d%0A     *
- 
 %0A     * 

correct typo in javadoc comments