Package cdc.impex.imports
Interface ImportRow
public interface ImportRow
Definition of an import row.
At the raw level, it is an (actual name, string value) map.
At the typed level, it is an (actual name, object value) map.
- Author:
- Damien Carbonne
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleandefault ImportActionDeprecated, for removal: This API element is subject to removal in a future version.getAction(Optional<ImportAction> defaultAction) Returns the action to take for the row: If an action is defined in the row, then it is returned.default <T> TgetData(ColumnTemplate<T> column, T def) Returns the data associated to a column or a default value.default <T> TReturns the data associated to a column or a default value.default ObjectReturns the data associated to a column or a default value.default <T> TgetDataOrDef(ColumnTemplate<T> column) Returns the data associated to a column or the column default value.default <T> TgetDataOrNull(ColumnTemplate<T> column) Returns the data associated to a column ornull.<T> TgetDataOrNull(Class<T> cls, String name) Returns the data associated to a column ornull.getDataOrNull(String name) Returns the data associated to a column ornull.List<cdc.issues.Issue>cdc.issues.locations.WorkbookLocationgetNames()intReturns the number (1-based) of this row.getRawDataOrNull(String name) Returns the raw data associated to a column ornull.booleanisEmpty()default booleanisErase(ColumnTemplate<?> column) Returnstrueif the data associated to a name column must be erased.booleanReturnstrueif the data associated to a column must be erased.
-
Field Details
-
ERASE
The special value used to erase (set to null) an attribute.This special value can only be used for updates of optional data.
- See Also:
-
-
Method Details
-
getSystemId
String getSystemId()- Returns:
- The systemId of the imported data.
-
getSheetName
String getSheetName()- Returns:
- The sheet name of the imported row.
-
getTemplateInstance
SheetTemplateInstance getTemplateInstance() -
getTemplate
SheetTemplate getTemplate()- Returns:
- The associated template.
-
getNames
- Returns:
- The column names.
-
getNumber
int getNumber()Returns the number (1-based) of this row.The first data row should start at 2.
- Returns:
- The row number (1-based).
-
getAction
Deprecated, for removal: This API element is subject to removal in a future version.UsegetAction(Optional).- Returns:
- The action to be taken for this row.
-
getAction
Returns the action to take for the row:- If an action is defined in the row, then it is returned.
- If no action is defined in the row, and
defaultActionis set, thendefaultActionis returned. - If no action is defined in the row, and
defaultActionis not set, thenSheetTemplate.getDefaultAction()is returned.
- Parameters:
defaultAction- The optional default action.- Returns:
- The action to be taken for this row.
-
isErase
Returnstrueif the data associated to a column must be erased.- Parameters:
name- The column name.- Returns:
trueif the data associated to column namednamemust be erased.- Throws:
IllegalArgumentException- Whennameisnull.
-
isErase
Returnstrueif the data associated to a name column must be erased.WARNING: MUST be used with a name column.
- Parameters:
column- The column.- Returns:
trueif the data associated tocolumnmust be erased.- Throws:
IllegalArgumentException- Whencolumnisnullor is not a name column.
-
getRawDataOrNull
Returns the raw data associated to a column ornull.- Parameters:
name- The column name.- Returns:
- The raw data associated to column named
nameornull. - Throws:
IllegalArgumentException- Whennameisnull.
-
getDataOrNull
Returns the data associated to a column ornull.If data must be erased,
nullis returned.- Parameters:
name- The column name.- Returns:
- The data associated to column named
nameornull. - Throws:
IllegalArgumentException- Whennameisnull.
-
getData
Returns the data associated to a column or a default value.If data must be erased, the default value
defis returned.- Parameters:
name- The column name.def- The default value.- Returns:
- The data associated to column named
nameordef. - Throws:
IllegalArgumentException- Whennameisnull.
-
getDataOrNull
Returns the data associated to a column ornull.WARNING: if data must be erased,
nullis returned.- Type Parameters:
T- The result type.- Parameters:
cls- The result class.name- The column name.- Returns:
- The data associated to column named
nameornull. - Throws:
IllegalArgumentException- Whenclsornameisnull.ClassCastException- When the associated data can not be converted tocls
-
getData
Returns the data associated to a column or a default value.WARNING: if data must be erased, the default value (
def) is returned.- Type Parameters:
T- The result type.- Parameters:
cls- The result class.name- The column name.def- The default value.- Returns:
- The data associated to column named
nameordef. - Throws:
IllegalArgumentException- Whenclsornameisnull.ClassCastException- When the associated data can not be converted tocls
-
getDataOrNull
Returns the data associated to a column ornull.WARNING: if data must be erased,
nullis returned.- Type Parameters:
T- The result type.- Parameters:
column- The column.- Returns:
- The data associated to
columnornull. - Throws:
IllegalArgumentException- Whencolumnisnullor is not a name column.ClassCastException- When the associated data can not be converted tocolumndata type.
-
getData
Returns the data associated to a column or a default value.WARNING: if data must be erased, the default value
defis returned.- Type Parameters:
T- The result type.- Parameters:
column- The column.def- The default value.- Returns:
- The data associated to
columnordef. - Throws:
IllegalArgumentException- Whencolumnisnullor is not a name.ClassCastException- When the associated data can not be converted tocolumndata type.
-
getDataOrDef
Returns the data associated to a column or the column default value.WARNING: if data must be erased, the column default value is returned.
- Type Parameters:
T- The result type.- Parameters:
column- The column.- Returns:
- The data associated to
columnor the column default value (ColumnTemplate.getDef()).
-
getIssues
List<cdc.issues.Issue> getIssues()- Returns:
- The issues associated to this row.
-
canBeProcessed
boolean canBeProcessed()- Returns:
trueif this row can be processed.
There are no CRITICAL (or more severe) issues.
-
isEmpty
boolean isEmpty()- Returns:
trueif this row is empty. This may happen when rows are removed from a sheet.
-
getLocation
cdc.issues.locations.WorkbookLocation getLocation()- Returns:
- The location corresponding to this row.
-
getAction(Optional).