You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/06/22 20:47:07 UTC
svn commit: r1604638 -
/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
Author: mattsicker
Date: Sun Jun 22 18:47:07 2014
New Revision: 1604638
URL: http://svn.apache.org/r1604638
Log:
Add javadoc to Level class.
Modified:
logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java?rev=1604638&r1=1604637&r2=1604638&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java Sun Jun 22 18:47:07 2014
@@ -116,10 +116,20 @@ public final class Level implements Comp
}
}
+ /**
+ * Gets the integral value of this Level.
+ *
+ * @return the value of this Level.
+ */
public int intLevel() {
return this.intLevel;
}
+ /**
+ * Gets the standard Level values as an enum.
+ *
+ * @return an enum of the standard Levels.
+ */
public StandardLevel getStandardLevel() {
return standardLevel;
}
@@ -173,7 +183,11 @@ public final class Level implements Comp
return this.name.hashCode();
}
-
+ /**
+ * Gets the symbolic name of this Level. Equivalent to calling {@link #toString()}.
+ *
+ * @return the name of this Level.
+ */
public String name() {
return this.name;
}
@@ -267,6 +281,19 @@ public final class Level implements Comp
throw new IllegalArgumentException("Unknown level constant [" + levelName + "].");
}
+ /**
+ * Returns the enum constant of the specified enum type with the specified name. The name must match exactly an
+ * identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
+ *
+ * @param enumType the {@code Class} object of the enum type from which to return a constant
+ * @param name the name of the constant to return
+ * @param <T> The enum type whose constant is to be returned
+ * @return the enum constant of the specified enum type with the specified name
+ * @throws java.lang.IllegalArgumentException if the specified enum type has no constant with the specified name,
+ * or the specified class object does not represent an enum type
+ * @throws java.lang.NullPointerException if {@code enumType} or {@code name} are {@code null}
+ * @see java.lang.Enum#valueOf(Class, String)
+ */
public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name) {
return Enum.valueOf(enumType, name);
}