Package org.apache.ofbiz.datafile
Class Record
java.lang.Object
org.apache.ofbiz.datafile.Record
- All Implemented Interfaces:
Serializable
Record
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Record
(ModelRecord modelRecord) Creates new Recordprotected
Record
(ModelRecord modelRecord, Map<String, Object> fields) Creates new Record from existing Map -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildRecord
(Record record) Add child record.static Record
createDelimitedRecord
(String line, int lineNum, ModelRecord modelRecord, char delimiter, String textDelimiter) static Record
createRecord
(ModelRecord modelRecord) Creates new Recordstatic Record
createRecord
(ModelRecord modelRecord, Map<String, Object> fields) Creates new Record from existing fields MapGet object.Gets child records.Gets date.Gets double.Gets float.getInteger
(String name) Gets integer.Gets long.Gets model record.Gets parent record.Gets record name.Gets string.getStringAndEmpty
(String name) Gets string and empty.Gets time.getTimestamp
(String name) Gets timestamp.void
Sets the named field to the passed value, even if the value is nullvoid
Sets the named field to the passed value.void
Sets the named field to the passed value, converting the value from a String to the current type usingType.valueOf()
-
Constructor Details
-
Record
Creates new Record -
Record
Creates new Record from existing Map
-
-
Method Details
-
getRecordName
Gets record name.- Returns:
- the record name
-
getModelRecord
Gets model record.- Returns:
- the model record
-
get
Get object.- Parameters:
name
- the name- Returns:
- the object
-
getString
Gets string.- Parameters:
name
- the name- Returns:
- the string
-
getStringAndEmpty
Gets string and empty.- Parameters:
name
- the name- Returns:
- the string and empty
-
getTimestamp
Gets timestamp.- Parameters:
name
- the name- Returns:
- the timestamp
-
getTime
Gets time.- Parameters:
name
- the name- Returns:
- the time
-
getDate
Gets date.- Parameters:
name
- the name- Returns:
- the date
-
getInteger
Gets integer.- Parameters:
name
- the name- Returns:
- the integer
-
getLong
Gets long.- Parameters:
name
- the name- Returns:
- the long
-
getFloat
Gets float.- Parameters:
name
- the name- Returns:
- the float
-
getDouble
Gets double.- Parameters:
name
- the name- Returns:
- the double
-
set
Sets the named field to the passed value, even if the value is null- Parameters:
name
- The field name to setvalue
- The value to set
-
set
Sets the named field to the passed value. If value is null, it is only set if the setIfNull parameter is true.- Parameters:
name
- The field name to setvalue
- The value to setsetIfNull
- Specifies whether or not to set the value if it is null
-
setString
Sets the named field to the passed value, converting the value from a String to the current type usingType.valueOf()
- Parameters:
name
- The field name to setvalue
- The String value to convert and set- Throws:
ParseException
-
getParentRecord
Gets parent record.- Returns:
- the parent record
-
getChildRecords
Gets child records.- Returns:
- the child records
-
addChildRecord
Add child record.- Parameters:
record
- the record
-
createRecord
Creates new Record- Parameters:
modelRecord
-- Returns:
- return the Record Object created
- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-
createRecord
public static Record createRecord(ModelRecord modelRecord, Map<String, Object> fields) throws DataFileExceptionCreates new Record from existing fields Map- Parameters:
modelRecord
-fields
-- Returns:
- return the Record Object created
- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-
createDelimitedRecord
public static Record createDelimitedRecord(String line, int lineNum, ModelRecord modelRecord, char delimiter, String textDelimiter) throws DataFileException - Parameters:
line
-lineNum
-modelRecord
-delimiter
-- Returns:
- return a Record Object
- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-