The default type used by GenericReader and GenericWriter for RecordSchema.
More...
|
| GenericRecord (RecordSchema schema) |
| Initializes a new instance of the GenericRecord class. More...
|
|
void | Add (string fieldName, object fieldValue) |
| Sets the value for a field. You may call this method multiple times with the same field name to change its value. The given field name must exist in the schema. This method does not ensure that the given field value is compatible with the field's schema. More...
|
|
bool | TryGetValue (string fieldName, out object result) |
| Gets the value the specified field name. More...
|
|
override bool | Equals (object obj) |
|
bool | Equals (GenericRecord other) |
|
override int | GetHashCode () |
|
override string | ToString () |
|
◆ GenericRecord()
Avro.Generic.GenericRecord.GenericRecord |
( |
RecordSchema |
schema | ) |
|
|
inline |
Initializes a new instance of the GenericRecord class.
- Parameters
-
◆ Add()
void Avro.Generic.GenericRecord.Add |
( |
string |
fieldName, |
|
|
object |
fieldValue |
|
) |
| |
|
inline |
Sets the value for a field. You may call this method multiple times with the same field name to change its value. The given field name must exist in the schema. This method does not ensure that the given field value is compatible with the field's schema.
- Parameters
-
fieldName | Name of the field. |
fieldValue | Value of the field. |
- Exceptions
-
◆ TryGetValue()
bool Avro.Generic.GenericRecord.TryGetValue |
( |
string |
fieldName, |
|
|
out object |
result |
|
) |
| |
|
inline |
Gets the value the specified field name.
- Parameters
-
fieldName | Name of the field. |
result | When this method returns true, contains the value of the specified field; otherwise, null. |
- Returns
- True if the field was found in the record. This method will only return true if Add(string, object) has been called for the given field name. This method cannot be used to determine whether or not the schema has a field with a given name.
◆ Schema
◆ this[string fieldName]
object Avro.Generic.GenericRecord.this[string fieldName] |
|
get |
Returns the value of the field with the given name.
- Parameters
-
fieldName | Name of the field. |
- Returns
- Value of the field with the given name.
- Exceptions
-
ArgumentNullException | fieldName is null. |
KeyNotFoundException | fieldName does not exist in this record. |
The documentation for this class was generated from the following file:
- src/apache/main/Generic/GenericRecord.cs