public class DataListEntry extends Object implements RecordData, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected DataListHead |
head |
protected int |
rownum |
protected Object[] |
values |
| Constructor and Description |
|---|
DataListEntry(DataListHead head,
Object[] values) |
DataListEntry(DataListHead head,
Object[] values,
int rownum) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
compareKey(Column[] keyColumns,
Object[] key)
Compares a given record key with the key of the entry
|
Object |
get(ColumnExpr column)
Returns a data value for the desired column .
|
<V> V |
get(ColumnExpr column,
Class<V> valueType)
returns the record value for a particular column
|
Object[] |
getArray(ColumnExpr... columns)
Returns an array of values for the given column expressions
|
boolean |
getBoolean(ColumnExpr column)
Returns a data value for the desired column.
|
boolean |
getBoolean(int index)
Returns a data value identified by the column index.
|
ColumnExpr |
getColumn(int index)
returns the column expression for a given column
This is the reverse operation of getFieldIndex()
|
Date |
getDate(ColumnExpr column)
Returns the value as as a java.util.Date object
The data value is converted to a Date if necessary.
|
Date |
getDate(int index)
Returns the value as as a java.util.Date object
The data value is converted to a Date if necessary.
|
BigDecimal |
getDecimal(ColumnExpr column)
Returns a data value for the desired column.
|
BigDecimal |
getDecimal(int index)
Returns a data value identified by the column index.
|
double |
getDouble(ColumnExpr column)
Returns a data value for the desired column.
|
double |
getDouble(int index)
Returns a data value identified by the column index.
|
<T extends Enum<?>> |
getEnum(Column column)
Returns the value of a field as an enum
This assumes that the column attribute "enumType" has been set to an enum type
For numeric columns the value is assumed to be an ordinal of the enumeration item
|
<T extends Enum<?>> |
getEnum(ColumnExpr column,
Class<T> enumType)
Returns the value of a field as an enum
For numeric columns the value is assumed to be an ordinal of the enumeration item
For non numeric columns the value is assumed to be the name of the enumeration item
|
<T extends Enum<?>> |
getEnum(int index,
Class<T> enumType)
Returns the value of a field as an enum
For numeric columns the value is assumed to be an ordinal of the enumeration item
For non numeric columns the value is assumed to be the name of the enumeration item
|
int |
getFieldCount()
returns the number of field available
|
int |
getFieldIndex(ColumnExpr column)
returns the index of the given column expression
Indexed operations provide better performance for bulk processing
|
int |
getFieldIndex(String column)
returns the index of the column expression with the given name
|
<T extends DataListHead> |
getHead() |
int |
getInt(ColumnExpr column)
Returns a data value for the desired column.
|
int |
getInt(int index)
Returns a data value identified by the column index.
|
LocalDate |
getLocalDate(ColumnExpr column)
Returns a data value for the desired column.
|
LocalDate |
getLocalDate(int index)
Returns a data value identified by the column index.
|
LocalDateTime |
getLocalDateTime(ColumnExpr column)
Returns a data value for the desired column.
|
LocalDateTime |
getLocalDateTime(int index)
Returns a data value identified by the column index.
|
long |
getLong(ColumnExpr column)
Returns a data value for the desired column.
|
long |
getLong(int index)
Returns a data value identified by the column index.
|
long |
getRecordId(Entity entity)
Returns the record id for a type of entity which has a single numeric primary key
|
Object[] |
getRecordKey(Entity entity)
Returns the record key for a type of entity
|
int |
getRownum()
Returns the row-number
This works only, if the row number has been set in the constructor
|
String |
getString(ColumnExpr column)
Returns a data value for the desired column.
|
String |
getString(int index)
Returns a data value identified by the column index.
|
String |
getText(ColumnExpr column)
Returns the value of a column as a formatted text
This converts the value to a string if necessary and performs an options lookup
To customize conversion please override convertToString()
|
String |
getText(String name)
Returns the value of a column as a formatted text
This converts the value to a string if necessary and performs an options lookup
To customize conversion please override convertToString()
|
Timestamp |
getTimestamp(ColumnExpr column)
Returns the value as as a java.sql.Timestamp object
|
Timestamp |
getTimestamp(int index)
Returns the value as as a java.sql.Timestamp object
|
Object |
getValue(int index)
Returns the raw field value based on the field index.
|
<V> V |
getValue(int index,
Class<V> valueType)
returns the record value for a particular column
|
boolean |
hasField(ColumnExpr column) |
boolean |
isNull(ColumnExpr column)
Checks whether or not the value for the given column is null.
|
boolean |
isNull(int index)
Checks whether or not the value for the given column is null.
|
boolean |
isZero(ColumnExpr column)
Returns true if a numeric value is Zero
For numeric columns only!
|
void |
modifyValue(ColumnExpr col,
Object value)
Modifies a particular value
|
int |
setBeanProperties(Object bean)
Injects the current field values into a java bean.
|
int |
setBeanProperties(Object bean,
Collection<? extends ColumnExpr> ignoreList)
Injects the current field values into a java bean.
|
protected void |
setBeanProperty(ColumnExpr column,
Object bean,
Object value)
Set a single property value on a java bean object
|
String |
toString() |
void |
updateData(RecordData recData)
Updates the fields of the entry with the corresponding fields of a record.
|
protected final DataListHead head
protected final Object[] values
protected int rownum
public DataListEntry(DataListHead head, Object[] values, int rownum)
public DataListEntry(DataListHead head, Object[] values)
public <T extends DataListHead> T getHead()
public Object[] getRecordKey(Entity entity)
entity - the entity type or rowset for which to get keypublic long getRecordId(Entity entity)
entity - the entity type or rowset for which to get keyInvalidArgumentException - if the entity has not a single numeric primary keypublic boolean compareKey(Column[] keyColumns, Object[] key)
keyColumns - the columns which make up the keykey - the key to compare the current entry topublic void updateData(RecordData recData)
recData - the record with the updated (newer) fieldspublic void modifyValue(ColumnExpr col, Object value)
col - the column to modifyvalue - the new valuepublic int getRownum()
public int getFieldCount()
RecordDatagetFieldCount in interface RecordDatapublic boolean hasField(ColumnExpr column)
public int getFieldIndex(ColumnExpr column)
RecordDatagetFieldIndex in interface RecordDatacolumn - the column for which to return the indexpublic int getFieldIndex(String column)
RecordDatagetFieldIndex in interface RecordDatacolumn - the name of the column for which to return the indexpublic ColumnExpr getColumn(int index)
RecordDatagetColumn in interface RecordDataindex - field index of the column expressionpublic Object getValue(int index)
getValue in interface RecordDataindex - the field indexpublic <V> V getValue(int index,
Class<V> valueType)
getValue in interface RecordDataV - the desired return type for the valueindex - the field index for which to return the valuevalueType - the desired value typepublic final <V> V get(ColumnExpr column, Class<V> valueType)
get in interface RecordDatacolumn - the column for which to return the valuevalueType - the desired value typepublic Object get(ColumnExpr column)
get in interface RecordDatacolumn - the column for which to obtain the valuepublic boolean isNull(int index)
isNull in interface RecordDataindex - index of the columnpublic final boolean isNull(ColumnExpr column)
isNull in interface RecordDatacolumn - identifying the columnpublic boolean isZero(ColumnExpr column)
column - the columnpublic final String getString(int index)
index - index of the columnpublic final String getString(ColumnExpr column)
column - identifying the columnpublic final int getInt(int index)
index - index of the columnpublic final int getInt(ColumnExpr column)
column - identifying the columnpublic final long getLong(int index)
index - index of the columnpublic final long getLong(ColumnExpr column)
column - identifying the columnpublic double getDouble(int index)
index - index of the columnpublic final double getDouble(ColumnExpr column)
column - identifying the columnpublic final BigDecimal getDecimal(int index)
index - index of the columnpublic final BigDecimal getDecimal(ColumnExpr column)
column - identifying the columnpublic final boolean getBoolean(int index)
index - index of the columnpublic final boolean getBoolean(ColumnExpr column)
column - identifying the columnpublic final Date getDate(int index)
index - index of the columnpublic final Date getDate(ColumnExpr column)
column - identifying the columnpublic final Timestamp getTimestamp(int index)
index - the column indexpublic final Timestamp getTimestamp(ColumnExpr column)
column - the timestamp columnpublic final LocalDate getLocalDate(int index)
index - index of the columnpublic final LocalDate getLocalDate(ColumnExpr column)
column - identifying the columnpublic final LocalDateTime getLocalDateTime(int index)
index - index of the columnpublic final LocalDateTime getLocalDateTime(ColumnExpr column)
column - identifying the columnpublic final <T extends Enum<?>> T getEnum(int index, Class<T> enumType)
T - the enum typeindex - index of the fieldenumType - the enum type classpublic final <T extends Enum<?>> T getEnum(ColumnExpr column, Class<T> enumType)
T - the enum typecolumn - the column for which to retrieve the valueenumType - the enum type classpublic final <T extends Enum<?>> T getEnum(Column column)
T - the enum typecolumn - the column for which to retrieve the valuepublic final Object[] getArray(ColumnExpr... columns)
columns - the column expressionspublic String getText(ColumnExpr column)
column - the column for which to get the formatted valuepublic final String getText(String name)
name - the column for which to get the formatted valuepublic int setBeanProperties(Object bean, Collection<? extends ColumnExpr> ignoreList)
setBeanProperties in interface RecordDatabean - the Java Bean for which to set the propertiesignoreList - list of columns to skip (optional)public final int setBeanProperties(Object bean)
bean - the Java Bean for which to set the propertiesprotected void setBeanProperty(ColumnExpr column, Object bean, Object value)
column - the column expressionbean - the beanvalue - the valueCopyright © 2008–2023 Apache Software Foundation. All rights reserved.