Added missing JavaDoc for the classes in org.jboss.netty.util
This commit is contained in:
parent
e11e0f7ed5
commit
e5f88b536b
|
@ -33,16 +33,21 @@ import org.jboss.netty.logging.InternalLogger;
|
||||||
import org.jboss.netty.logging.InternalLoggerFactory;
|
import org.jboss.netty.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* A set of utility methods related with a {@link Map}.
|
||||||
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
*
|
*
|
||||||
* @version $Rev$, $Date$
|
* @version $Rev$, $Date$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class MapUtil {
|
public class MapUtil {
|
||||||
private static final InternalLogger logger =
|
private static final InternalLogger logger =
|
||||||
InternalLoggerFactory.getInstance(MapUtil.class);
|
InternalLoggerFactory.getInstance(MapUtil.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code true} if and only if the specified {@code map} is an
|
||||||
|
* ordered map, like {@link LinkedHashMap} is.
|
||||||
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static boolean isOrderedMap(Map<?, ?> map) {
|
public static boolean isOrderedMap(Map<?, ?> map) {
|
||||||
Class<?> mapType = map.getClass();
|
Class<?> mapType = map.getClass();
|
||||||
|
|
|
@ -26,7 +26,14 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.jboss.netty.channel.DefaultChannelPipeline;
|
||||||
|
import org.jboss.netty.channel.SimpleChannelHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Simplifies an exception stack trace by removing unnecessary
|
||||||
|
* {@link StackTraceElement}s. Please note that the stack trace simplification
|
||||||
|
* is disabled if {@linkplain DebugUtil debug mode} is turned on.
|
||||||
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
*
|
*
|
||||||
|
@ -42,6 +49,11 @@ public class StackTraceSimplifier {
|
||||||
"(util\\.(ThreadRenamingRunnable)" +
|
"(util\\.(ThreadRenamingRunnable)" +
|
||||||
"|channel\\.(SimpleChannelHandler|DefaultChannelPipeline.*))$");
|
"|channel\\.(SimpleChannelHandler|DefaultChannelPipeline.*))$");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes unnecessary {@link StackTraceElement}s from the specified
|
||||||
|
* exception. {@link ThreadRenamingRunnable}, {@link SimpleChannelHandler},
|
||||||
|
* and {@link DefaultChannelPipeline} will be dropped from the trace.
|
||||||
|
*/
|
||||||
public static void simplify(Throwable e) {
|
public static void simplify(Throwable e) {
|
||||||
if (!SIMPLIFY_STACK_TRACE) {
|
if (!SIMPLIFY_STACK_TRACE) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
package org.jboss.netty.util;
|
package org.jboss.netty.util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Accesses the system property swallowing a {@link SecurityException}.
|
||||||
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
*
|
*
|
||||||
|
@ -31,6 +33,14 @@ package org.jboss.netty.util;
|
||||||
*/
|
*/
|
||||||
public class SystemPropertyUtil {
|
public class SystemPropertyUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the Java system property with the specified
|
||||||
|
* {@code key}.
|
||||||
|
*
|
||||||
|
* @return the property value.
|
||||||
|
* {@code null} if there's no such property or if an access to the
|
||||||
|
* specified property is not allowed.
|
||||||
|
*/
|
||||||
public static String get(String key) {
|
public static String get(String key) {
|
||||||
try {
|
try {
|
||||||
return System.getProperty(key);
|
return System.getProperty(key);
|
||||||
|
@ -39,6 +49,15 @@ public class SystemPropertyUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the Java system property with the specified
|
||||||
|
* {@code key}, while falling back to the specified default value if
|
||||||
|
* the property access fails.
|
||||||
|
*
|
||||||
|
* @return the property value.
|
||||||
|
* {@code def} if there's no such property or if an access to the
|
||||||
|
* specified property is not allowed.
|
||||||
|
*/
|
||||||
public static String get(String key, String def) {
|
public static String get(String key, String def) {
|
||||||
String value = get(key);
|
String value = get(key);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user