public class Generics
extends java.lang.Object
Constructor and Description |
---|
Generics() |
Modifier and Type | Method and Description |
---|---|
static <T> java.lang.Class<T> |
cast(java.lang.Class cls)
Returns a type-safe generic class of the given type-less class.
|
static <T> java.util.Collection<T> |
cast(java.util.Collection col)
Returns a type-safe generic collection of the given un-typed collection.
|
static <T> java.util.Enumeration<T> |
cast(java.util.Enumeration en)
Returns a type-safe generic enumeration of the given un-typed enumeration.
|
static <T> java.util.Iterator<T> |
cast(java.util.Iterator it)
Returns a type-safe generic iterator of the given un-typed iterator.
|
static <T> java.util.List<T> |
cast(java.util.List list)
Returns a type-safe generic list of the given un-typed list.
|
static <T> java.util.ListIterator<T> |
cast(java.util.ListIterator it)
Returns a type-safe generic list iterator of the given un-typed list iterator.
|
static <K,V> java.util.Map<K,V> |
cast(java.util.Map map)
Returns a type-safe generic map of the given un-typed map.
|
static <T> T |
cast(java.lang.Object o)
Force to cast an object to the given type.
|
static <T> java.util.Set<T> |
cast(java.util.Set set)
Returns a type-safe generic set of the given un-typed set.
|
static <T> java.lang.ThreadLocal<T> |
cast(java.lang.ThreadLocal tl)
Returns a type-safe generic thread-local of the given un-typed thread-local.
|
public static final <T> java.lang.Class<T> cast(java.lang.Class cls)
public static final <T> T cast(java.lang.Object o)
o
is an instance of T.public static final <T> java.util.Iterator<T> cast(java.util.Iterator it)
public static final <T> java.util.ListIterator<T> cast(java.util.ListIterator it)
public static final <T> java.util.Enumeration<T> cast(java.util.Enumeration en)
public static final <T> java.util.Collection<T> cast(java.util.Collection col)
public static final <T> java.util.List<T> cast(java.util.List list)
public static final <T> java.util.Set<T> cast(java.util.Set set)
public static final <K,V> java.util.Map<K,V> cast(java.util.Map map)
public static final <T> java.lang.ThreadLocal<T> cast(java.lang.ThreadLocal tl)
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.