|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.lang.Generics
public class Generics
Utilities to handle generic types, such as converting a non-type object to a generic type without warning.
| Constructor Summary | |
|---|---|
Generics()
|
|
| Method Summary | ||
|---|---|---|
static
|
cast(Class cls)
Returns a type-safe generic class of the given type-less class. |
|
static
|
cast(Collection col)
Returns a type-safe generic collection of the given un-typed collection. |
|
static
|
cast(Enumeration en)
Returns a type-safe generic enumeration of the given un-typed enumeration. |
|
static
|
cast(Iterator it)
Returns a type-safe generic iterator of the given un-typed iterator. |
|
static
|
cast(List list)
Returns a type-safe generic list of the given un-typed list. |
|
static
|
cast(ListIterator it)
Returns a type-safe generic list iterator of the given un-typed list iterator. |
|
static
|
cast(Map map)
Returns a type-safe generic map of the given un-typed map. |
|
static
|
cast(Object o)
Force to cast an object to the given type. |
|
static
|
cast(Set set)
Returns a type-safe generic set of the given un-typed set. |
|
static
|
cast(ThreadLocal tl)
Returns a type-safe generic thread-local of the given un-typed thread-local. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Generics()
| Method Detail |
|---|
public static final <T> Class<T> cast(Class cls)
public static final <T> T cast(Object o)
o
is an instance of T.
public static final <T> Iterator<T> cast(Iterator it)
public static final <T> ListIterator<T> cast(ListIterator it)
public static final <T> Enumeration<T> cast(Enumeration en)
public static final <T> Collection<T> cast(Collection col)
public static final <T> List<T> cast(List list)
public static final <T> Set<T> cast(Set set)
public static final <K,V> Map<K,V> cast(Map map)
public static final <T> ThreadLocal<T> cast(ThreadLocal tl)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||