Class FixLenRow
java.lang.Object
com.onenetwork.platform.integ.fixlen.FixLenRow
public class FixLenRow
extends java.lang.Object
Represents a row of values in a fixed-length format file
-
Constructor Summary
Constructors Constructor Description FixLenRow(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> map)
-
Method Summary
Modifier and Type Method Description FixLenField
addField(java.lang.String fieldName, int occurrence, java.lang.String fieldValue)
Sets the field value for the given field name.FixLenField
addField(java.lang.String fieldName, java.lang.String fieldValue)
Sets the field value for the given field name in the FixLenRow.java.util.List<FixLenField>
getFields()
java.lang.String
getFieldValue(java.lang.String fieldName)
Gets the field value using field name - fetches the first field with the name if multiple fields have the same namejava.lang.String
getFieldValue(java.lang.String fieldName, int occurrenceNumber)
Gets the field value using field name and occurrenceNumber - if multiple fields have the same name, the occurenceNumber (1st, 2nd, etc) is used to fetch the fieldFixLenField
getFixLenField(int fieldPosition)
Fetches the FixLenField from the FixLenRow using fieldPositionjava.lang.String
getRawData()
void
setFields(java.util.List<FixLenField> fields)
void
setRawData(java.lang.String rawData)
-
Constructor Details
-
FixLenRow
public FixLenRow(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> map)
-
-
Method Details
-
getFields
-
setFields
-
getFieldValue
public java.lang.String getFieldValue(java.lang.String fieldName)Gets the field value using field name - fetches the first field with the name if multiple fields have the same name- Parameters:
fieldName
- name of the field to be fetched- Returns:
- field value
-
getFieldValue
public java.lang.String getFieldValue(java.lang.String fieldName, int occurrenceNumber)Gets the field value using field name and occurrenceNumber - if multiple fields have the same name, the occurenceNumber (1st, 2nd, etc) is used to fetch the field- Parameters:
fieldName
- name of the field to be fetchedoccurrenceNumber
- 1-based indexed field's occurrence number (1st occurrence, 2nd occurrence, etc)- Returns:
- field value
-
getFixLenField
Fetches the FixLenField from the FixLenRow using fieldPosition- Parameters:
position
- Position of the field in the FixLenRow - starts with 1- Returns:
- fixLenField FixLenField at the specified fieldPosition
-
addField
Sets the field value for the given field name in the FixLenRow. If the same field name occurs more than once, the one that occurs first is set- Parameters:
fieldName
-fieldValue
-- Returns:
- fixLenField
-
addField
public FixLenField addField(java.lang.String fieldName, int occurrence, java.lang.String fieldValue)Sets the field value for the given field name. If the same field name occurs more than once, the occurrence number is to be provided- Parameters:
fieldName
-occurrence
- 1-based indexed field's occurrence number (1st occurrence, 2nd occurrence, etc)fieldValue
-- Returns:
- fixLenField
-
getRawData
public java.lang.String getRawData()- Returns:
- the current row's content in raw format, not split into fields
-
setRawData
public void setRawData(java.lang.String rawData)- Parameters:
rawData
- current row's content in raw format, not split into fields
-