public final class Column<T>
extends java.lang.Object
Class represents a column of data and to be used with the Columns.
Each column is identified by an instance of the ColumnKey with the same type
and contains a collection of 'data'. Column doesn't perform any assertion or validation of the data,
it just holds it.
Note: class doesn't override default hash-code and equals functionality. Each column is immutable and unique "by instance" so they can be compared by links.
| Modifier and Type | Field and Description |
|---|---|
java.util.List<T> |
data |
ColumnKey<T> |
key |
| Constructor and Description |
|---|
Column(ColumnKey<T> key,
java.util.Collection<T> data)
If specified collection is
null - result column will contain empty list as data. |
Column(ColumnKey<T> key,
T... data)
Equal to
Column(ColumnKey, Collection) with specified data
wrapped into Arrays.asList(Object...) |
| Modifier and Type | Method and Description |
|---|---|
static <A> Column<A> |
create(java.lang.Class<A> type,
A... data) |
static <A> Column<A> |
create(java.lang.Class<A> type,
java.util.Collection<A> data) |
java.util.List<T> |
getData() |
ColumnKey<T> |
getKey() |
java.lang.Class<T> |
getType()
Equal to #getKey().getType()
|
java.lang.String |
toString() |
@SafeVarargs public Column(ColumnKey<T> key, T... data)
Column(ColumnKey, Collection) with specified data
wrapped into Arrays.asList(Object...)@SafeVarargs public static <A> Column<A> create(java.lang.Class<A> type, A... data)
public static <A> Column<A> create(java.lang.Class<A> type, java.util.Collection<A> data)
public java.lang.Class<T> getType()
public java.util.List<T> getData()
public java.lang.String toString()
toString in class java.lang.Object