@Private
@Unstable
public class GenericsUtil
extends java.lang.Object
| Constructor | Description |
|---|---|
GenericsUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> java.lang.Class<T> |
getClass(T t) |
Returns the Class object (of type
Class<T>) of the
argument of type T. |
static boolean |
isLog4jLogger(java.lang.Class<?> clazz) |
Determine whether the log of
clazz is Log4j implementation. |
static boolean |
isLog4jLogger(java.lang.String logger) |
Determine whether the log of the given logger is of Log4J implementation.
|
static <T> T[] |
toArray(java.lang.Class<T> c,
java.util.List<T> list) |
Converts the given
List<T> to a an array of
T[]. |
static <T> T[] |
toArray(java.util.List<T> list) |
Converts the given
List<T> to a an array of
T[]. |
public static <T> java.lang.Class<T> getClass(T t)
Class<T>) of the
argument of type T.T - The type of the argumentt - the object to get it classClass<T>public static <T> T[] toArray(java.lang.Class<T> c,
java.util.List<T> list)
List<T> to a an array of
T[].T - Generics Type T.c - the Class object of the items in the listlist - the list to convertpublic static <T> T[] toArray(java.util.List<T> list)
List<T> to a an array of
T[].T - Generics Type T.list - the list to convertjava.lang.ArrayIndexOutOfBoundsException - if the list is empty.
Use toArray(Class, List) if the list may be empty.public static boolean isLog4jLogger(java.lang.Class<?> clazz)
clazz is Log4j implementation.clazz - a class to be determinedclazz is Log4j implementation.public static boolean isLog4jLogger(java.lang.String logger)
logger - the logger name, usually class name as string.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.