Class Record

java.lang.Object
org.apache.ofbiz.datafile.Record
All Implemented Interfaces:
Serializable

public class Record extends Object implements Serializable
Record
See Also:
  • Constructor Details

    • Record

      protected Record(ModelRecord modelRecord)
      Creates new Record
    • Record

      protected Record(ModelRecord modelRecord, Map<String,Object> fields)
      Creates new Record from existing Map
  • Method Details

    • getRecordName

      public String getRecordName()
      Gets record name.
      Returns:
      the record name
    • getModelRecord

      public ModelRecord getModelRecord()
      Gets model record.
      Returns:
      the model record
    • get

      public Object get(String name)
      Get object.
      Parameters:
      name - the name
      Returns:
      the object
    • getString

      public String getString(String name)
      Gets string.
      Parameters:
      name - the name
      Returns:
      the string
    • getStringAndEmpty

      public String getStringAndEmpty(String name)
      Gets string and empty.
      Parameters:
      name - the name
      Returns:
      the string and empty
    • getTimestamp

      public Timestamp getTimestamp(String name)
      Gets timestamp.
      Parameters:
      name - the name
      Returns:
      the timestamp
    • getTime

      public Time getTime(String name)
      Gets time.
      Parameters:
      name - the name
      Returns:
      the time
    • getDate

      public Date getDate(String name)
      Gets date.
      Parameters:
      name - the name
      Returns:
      the date
    • getInteger

      public Integer getInteger(String name)
      Gets integer.
      Parameters:
      name - the name
      Returns:
      the integer
    • getLong

      public Long getLong(String name)
      Gets long.
      Parameters:
      name - the name
      Returns:
      the long
    • getFloat

      public Float getFloat(String name)
      Gets float.
      Parameters:
      name - the name
      Returns:
      the float
    • getDouble

      public Double getDouble(String name)
      Gets double.
      Parameters:
      name - the name
      Returns:
      the double
    • set

      public void set(String name, Object value)
      Sets the named field to the passed value, even if the value is null
      Parameters:
      name - The field name to set
      value - The value to set
    • set

      public void set(String name, Object value, boolean setIfNull)
      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 set
      value - The value to set
      setIfNull - Specifies whether or not to set the value if it is null
    • setString

      public void setString(String name, String value) throws ParseException
      Sets the named field to the passed value, converting the value from a String to the current type using Type.valueOf()
      Parameters:
      name - The field name to set
      value - The String value to convert and set
      Throws:
      ParseException
    • getParentRecord

      public Record getParentRecord()
      Gets parent record.
      Returns:
      the parent record
    • getChildRecords

      public List<Record> getChildRecords()
      Gets child records.
      Returns:
      the child records
    • addChildRecord

      public void addChildRecord(Record record)
      Add child record.
      Parameters:
      record - the record
    • createRecord

      public static Record createRecord(ModelRecord modelRecord) throws DataFileException
      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 DataFileException
      Creates 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