Package guru.mikelue.jdut.datagrain
Class DataField<T>
- java.lang.Object
-
- guru.mikelue.jdut.datagrain.DataField<T>
-
- Type Parameters:
T
- The type of data
public class DataField<T> extends Object
Container with data of a field.
This class would call the supplier only once, and keep the value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataField.Factory
Utility factory to compose fields for a table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map.Entry<String,DataField<T>>
asMapEntry()
Turns this field to map entry.protected DataField<T>
clone()
boolean
equals(Object obj)
Compares the column definition and data.SchemaColumn
getColumn()
Gets definition of column.String
getColumnName()
Gets name of column.T
getData()
Gets data or gets bySupplier
of data.Optional<Supplier<? extends T>>
getDataSupplier()
Gets data supplier of this field.SchemaTable
getTable()
Gets definition of table.String
getTableName()
Gets name of table.int
hashCode()
Hashes the column definition and data.
-
-
-
Method Detail
-
getTable
public SchemaTable getTable()
Gets definition of table.- Returns:
- The definition of table
- See Also:
getTableName()
-
getTableName
public String getTableName()
Gets name of table.- Returns:
- the name of table
- See Also:
getTable()
-
getColumn
public SchemaColumn getColumn()
Gets definition of column.- Returns:
- The definition of column
- See Also:
getColumnName()
-
getColumnName
public String getColumnName()
Gets name of column.- Returns:
- The name of column
- See Also:
getColumn()
-
getData
public T getData()
Gets data or gets bySupplier
of data. This method would call the supplier only once, and keep the value.- Returns:
- The data this field is holding
-
getDataSupplier
public Optional<Supplier<? extends T>> getDataSupplier()
Gets data supplier of this field.- Returns:
- The data supplier, may be empty
-
asMapEntry
public Map.Entry<String,DataField<T>> asMapEntry()
Turns this field to map entry.- Returns:
- The entry for
Map
-
equals
public boolean equals(Object obj)
Compares the column definition and data.
-
-