Package org.apache.empire.data.list
Class DataListEntry
java.lang.Object
org.apache.empire.data.list.DataListEntry
- All Implemented Interfaces:
Serializable,RecordData
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DataListHeadprotected intprotected final Object[] -
Constructor Summary
ConstructorsConstructorDescriptionDataListEntry(DataListHead head, Object[] values) DataListEntry(DataListHead head, Object[] values, int rownum) -
Method Summary
Modifier and TypeMethodDescriptionbooleancompareKey(Column[] keyColumns, Object[] key) Compares a given record key with the key of the entryget(ColumnExpr column) Returns a data value for the desired column .final <V> Vget(ColumnExpr column, Class<V> valueType) returns the record value for a particular columnfinal Object[]getArray(ColumnExpr... columns) Returns an array of values for the given column expressionsfinal booleangetBoolean(int index) Returns a data value identified by the column index.final booleangetBoolean(ColumnExpr column) Returns a data value for the desired column.getColumn(int index) returns the column expression for a given column This is the reverse operation of getFieldIndex()final DategetDate(int index) Returns the value as as a java.util.Date object The data value is converted to a Date if necessary.final DategetDate(ColumnExpr column) Returns the value as as a java.util.Date object The data value is converted to a Date if necessary.final BigDecimalgetDecimal(int index) Returns a data value identified by the column index.final BigDecimalgetDecimal(ColumnExpr column) Returns a data value for the desired column.doublegetDouble(int index) Returns a data value identified by the column index.final doublegetDouble(ColumnExpr column) Returns a data value for the desired column.final <T extends Enum<?>>
TReturns 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 itemfinal <T extends Enum<?>>
TReturns 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 itemfinal <T extends Enum<?>>
TgetEnum(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 itemintreturns the number of field availableintgetFieldIndex(String column) returns the index of the column expression with the given nameintgetFieldIndex(ColumnExpr column) returns the index of the given column expression Indexed operations provide better performance for bulk processing<T extends DataListHead>
TgetHead()final intgetInt(int index) Returns a data value identified by the column index.final intgetInt(ColumnExpr column) Returns a data value for the desired column.final LocalDategetLocalDate(int index) Returns a data value identified by the column index.final LocalDategetLocalDate(ColumnExpr column) Returns a data value for the desired column.final LocalDateTimegetLocalDateTime(int index) Returns a data value identified by the column index.final LocalDateTimegetLocalDateTime(ColumnExpr column) Returns a data value for the desired column.final longgetLong(int index) Returns a data value identified by the column index.final longgetLong(ColumnExpr column) Returns a data value for the desired column.longgetRecordId(Entity entity) Returns the record id for a type of entity which has a single numeric primary keyObject[]getRecordKey(Entity entity) Returns the record key for a type of entityintReturns the row-number This works only, if the row number has been set in the constructorfinal StringgetString(int index) Returns a data value identified by the column index.final StringgetString(ColumnExpr column) Returns a data value for the desired 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()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()final TimestampgetTimestamp(int index) Returns the value as as a java.sql.Timestamp objectfinal TimestampgetTimestamp(ColumnExpr column) Returns the value as as a java.sql.Timestamp objectgetValue(int index) Returns the raw field value based on the field index.<V> Vreturns the record value for a particular columnbooleanhasField(ColumnExpr column) booleanisNull(int index) Checks whether or not the value for the given column is null.final booleanisNull(ColumnExpr column) Checks whether or not the value for the given column is null.booleanisZero(ColumnExpr column) Returns true if a numeric value is Zero For numeric columns only!voidmodifyValue(ColumnExpr col, Object value) Modifies a particular valuefinal intsetBeanProperties(Object bean) Injects the current field values into a java bean.intsetBeanProperties(Object bean, Collection<? extends ColumnExpr> ignoreList) Injects the current field values into a java bean.protected voidsetBeanProperty(ColumnExpr column, Object bean, Object value) Set a single property value on a java bean objecttoString()voidupdateData(RecordData recData) Updates the fields of the entry with the corresponding fields of a record.
-
Field Details
-
head
-
values
-
rownum
protected int rownum
-
-
Constructor Details
-
DataListEntry
-
DataListEntry
-
-
Method Details
-
getHead
-
getRecordKey
Returns the record key for a type of entity- Parameters:
entity- the entity type or rowset for which to get key- Returns:
- the record key
-
getRecordId
Returns the record id for a type of entity which has a single numeric primary key- Parameters:
entity- the entity type or rowset for which to get key- Returns:
- the record id
- Throws:
InvalidArgumentException- if the entity has not a single numeric primary key
-
compareKey
Compares a given record key with the key of the entry- Parameters:
keyColumns- the columns which make up the keykey- the key to compare the current entry to- Returns:
- true if the keys match or false otherwise
-
updateData
Updates the fields of the entry with the corresponding fields of a record.- Parameters:
recData- the record with the updated (newer) fields
-
modifyValue
Modifies a particular value- Parameters:
col- the column to modifyvalue- the new value
-
getRownum
public int getRownum()Returns the row-number This works only, if the row number has been set in the constructor- Returns:
- the row number
-
getFieldCount
public int getFieldCount()Description copied from interface:RecordDatareturns the number of field available- Specified by:
getFieldCountin interfaceRecordData- Returns:
- field count
-
hasField
-
getFieldIndex
Description copied from interface:RecordDatareturns the index of the given column expression Indexed operations provide better performance for bulk processing- Specified by:
getFieldIndexin interfaceRecordData- Parameters:
column- the column for which to return the index- Returns:
- the field index of the given column
-
getFieldIndex
Description copied from interface:RecordDatareturns the index of the column expression with the given name- Specified by:
getFieldIndexin interfaceRecordData- Parameters:
column- the name of the column for which to return the index- Returns:
- the field index of the given column
-
getColumn
Description copied from interface:RecordDatareturns the column expression for a given column This is the reverse operation of getFieldIndex()- Specified by:
getColumnin interfaceRecordData- Parameters:
index- field index of the column expression- Returns:
- the column expression object or null if the index is out of range
-
getValue
Returns the raw field value based on the field index.- Specified by:
getValuein interfaceRecordData- Parameters:
index- the field index- Returns:
- the raw field value
-
getValue
returns the record value for a particular column- Specified by:
getValuein interfaceRecordData- Type Parameters:
V- the desired return type for the value- Parameters:
index- the field index for which to return the valuevalueType- the desired value type- Returns:
- the record value for the given column
-
get
returns the record value for a particular column- Specified by:
getin interfaceRecordData- Parameters:
column- the column for which to return the valuevalueType- the desired value type- Returns:
- the record value for the given column
-
get
Returns a data value for the desired column .- Specified by:
getin interfaceRecordData- Parameters:
column- the column for which to obtain the value- Returns:
- the record value
-
isNull
public boolean isNull(int index) Checks whether or not the value for the given column is null.- Specified by:
isNullin interfaceRecordData- Parameters:
index- index of the column- Returns:
- true if the value is null or false otherwise
-
isNull
Checks whether or not the value for the given column is null.- Specified by:
isNullin interfaceRecordData- Parameters:
column- identifying the column- Returns:
- true if the value is null or false otherwise
-
isZero
Returns true if a numeric value is Zero For numeric columns only!- Parameters:
column- the column- Returns:
- true if the value is zero or false otherwise
-
getString
Returns a data value identified by the column index. The data value is converted to a string if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getString
Returns a data value for the desired column. The data value is converted to a string if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getInt
public final int getInt(int index) Returns a data value identified by the column index. The value is converted to integer if necessary .- Parameters:
index- index of the column- Returns:
- the record value
-
getInt
Returns a data value for the desired column. The data value is converted to integer if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getLong
public final long getLong(int index) Returns a data value identified by the column index. The data value is converted to a long if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getLong
Returns a data value for the desired column. The data value is converted to a long if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getDouble
public double getDouble(int index) Returns a data value identified by the column index. The data value is converted to double if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getDouble
Returns a data value for the desired column. The data value is converted to double if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getDecimal
Returns a data value identified by the column index. The data value is converted to double if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getDecimal
Returns a data value for the desired column. The data value is converted to BigDecimal if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getBoolean
public final boolean getBoolean(int index) Returns a data value identified by the column index. The data value is converted to boolean if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getBoolean
Returns a data value for the desired column. The data value is converted to boolean if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getDate
Returns the value as as a java.util.Date object The data value is converted to a Date if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getDate
Returns the value as as a java.util.Date object The data value is converted to a Date if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getTimestamp
Returns the value as as a java.sql.Timestamp object- Parameters:
index- the column index- Returns:
- the timestamp value
-
getTimestamp
Returns the value as as a java.sql.Timestamp object- Parameters:
column- the timestamp column- Returns:
- the timestamp value
-
getLocalDate
Returns a data value identified by the column index. The data value is converted to a Date if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getLocalDate
Returns a data value for the desired column. The data value is converted to a Date if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getLocalDateTime
Returns a data value identified by the column index. The data value is converted to a Date if necessary.- Parameters:
index- index of the column- Returns:
- the value
-
getLocalDateTime
Returns a data value for the desired column. The data value is converted to a Date if necessary.- Parameters:
column- identifying the column- Returns:
- the value
-
getEnum
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- Type Parameters:
T- the enum type- Parameters:
index- index of the fieldenumType- the enum type class- Returns:
- the enum value
-
getEnum
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- Type Parameters:
T- the enum type- Parameters:
column- the column for which to retrieve the valueenumType- the enum type class- Returns:
- the enum value
-
getEnum
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- Type Parameters:
T- the enum type- Parameters:
column- the column for which to retrieve the value- Returns:
- the enum value
-
getArray
Returns an array of values for the given column expressions- Parameters:
columns- the column expressions- Returns:
- the corresponding record values
-
getText
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()- Parameters:
column- the column for which to get the formatted value- Returns:
- the formatted value
-
getText
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()- Parameters:
columnName- the column for which to get the formatted value- Returns:
- the formatted value
-
setBeanProperties
Injects the current field values into a java bean. The property name is detected by ColumnExpr.getBeanPropertyName()- Specified by:
setBeanPropertiesin interfaceRecordData- Parameters:
bean- the Java Bean for which to set the propertiesignoreList- list of columns to skip (optional)- Returns:
- the number of bean properties set on the supplied bean
-
setBeanProperties
Injects the current field values into a java bean. The property name is detected by ColumnExpr.getBeanPropertyName()- Parameters:
bean- the Java Bean for which to set the properties- Returns:
- the number of bean properties set on the supplied bean
-
setBeanProperty
Set a single property value on a java bean object- Parameters:
column- the column expressionbean- the beanvalue- the value
-
toString
-