OERecord¶
class OERecord
The OERecord class is a data container for named, typed data.
Constructors¶
OERecord()
The default constructor initializes the record object to an empty record with no fields or values.
OERecord(rhs: OERecord)
Copy constructor.
add_field¶
add_field(field: OEFieldBase) -> bool
Adds an empty field to the record and returns True if successful.
See also
clear_value¶
clear_value(field: OEFieldBase) -> bool
Removes the specified field’s value from the record. The field will still exist, but will have no associated value. Returns False if no such field or value exist.
delete_field¶
delete_field(field: OEFieldBase) -> bool
Removes the field and the associated data from the record.
See also
get_field¶
get_field(name: str, includeMeta: bool=True) -> object
Returns the field with the specified name and type from the record. If no such field exists on the record, an empty (and unusable) field object is returned.
- name
The name of the field to retrieve from the record.
- includeMeta
If this is True, the returned field will include the record’s metadata for the field.
See also
OERecord.has_field
method
get_field_meta¶
get_field_meta(name: str) -> OEFieldMeta
Returns an OEFieldMeta object containing the metadata from the named field. If the field does not exist, or the field exists but contains no metadata, an empty OEFieldMeta object is returned.
- name
The name of the field to retrieve the metadata from.
See also
OERecord.has_field
methodOEFieldMeta class
get_fields¶
get_fields() -> List[object]
get_fields(fieldType: OEFieldTypeHandler) -> List[object]
Returns the field objects from the record.
- fieldType
This parameter specifies the type of the field to match.
See also
OERecord.has_field
methodOEFieldBase class
get_value¶
get_value(field: OEField) -> Any
Retrieves the value from a field on the record. If no such value exists on the record, this will return None.
- field
The field from which the value is retrieved.
See also
has_field¶
has_field(field: OEField, matchMeta: bool=false) -> bool
Tests for existence of a field on the record, and returns True if a field of the specified name and type exists, regardless of whether the field contains a value.
- field
The field to test for on the record.
- matchMeta
When true, all metadata on the field parameter must be present on the record’s field to return true.
See also
has_value¶
has_value(field: OEFieldBase) -> bool
Tests for presence of a value on the record for the specified field, and returns true if such a value exists. The method will return false if no matching value can be found or if the specified field does not exist on the record.
- field
The field to check for a value.
See also
OEFieldBase class
is_na¶
is_na(field: OEFieldBase) -> bool is_na(fieldName: str) -> bool
Returns True if the specified field contains a null value. Note that this is different from the field not containing a value at all.
- field
The field to test.
- fieldName
The name of the field to test.
set_value¶
set_value(field: OEField, value: Any) -> bool
Sets the specified value on the record, and returns True if successful.
- field
The field to set the value for. If the field exists, its value will be overwritten. If the field doesn’t exist on the record, it will be added.
- value
The value to be added to the record.
See also
check_field¶
check_field(const OEFieldBase &field, bool matchMeta=false) -> int
Tests the existence and state of a field on a record, and returns a
value from the OERecordReturnCode
namespace.
- field
The field to test.
- matchMeta
If this argument is True, the test for a matching field will include the field parameter’s metadata.
See also
OERecord.has_field
methodOERecord.has_value
method