org.jvnet.tiger_types
public abstract class Lister<T> extends java.lang.Object
List
, etc)
of items.Modifier and Type | Field and Description |
---|---|
java.lang.reflect.Type |
itemGenericType |
java.lang.Class |
itemType
Type of the individual item
|
protected java.util.Collection |
r |
Modifier | Constructor and Description |
---|---|
protected |
Lister(java.lang.Class itemType,
java.lang.reflect.Type itemGenericType) |
protected |
Lister(java.lang.Class itemType,
java.lang.reflect.Type itemGenericType,
java.util.Collection r) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object o) |
static <T> Lister<T> |
create(java.lang.Class<T> c,
java.lang.reflect.Type t)
Creates a
Lister instance that produces the given type. |
static Lister |
create(java.lang.reflect.Type t)
Creates a
Lister instance that produces the given type. |
abstract T |
toCollection() |
public final java.lang.Class itemType
public final java.lang.reflect.Type itemGenericType
protected final java.util.Collection r
protected Lister(java.lang.Class itemType, java.lang.reflect.Type itemGenericType)
protected Lister(java.lang.Class itemType, java.lang.reflect.Type itemGenericType, java.util.Collection r)
public void add(java.lang.Object o)
public abstract T toCollection()
public static Lister create(java.lang.reflect.Type t)
Lister
instance that produces the given type.public static <T> Lister<T> create(java.lang.Class<T> c, java.lang.reflect.Type t)
Lister
instance that produces the given type.c
- The erasure version of 't'. This is taken
as a parameter as a performance optimizaiton.java.lang.IllegalArgumentException
- if the given type does look like a collection yet this implementation
is not capable of how to handle it.Copyright © 2014. All Rights Reserved.