setFieldValue method

dynamic setFieldValue(
  1. int fieldID,
  2. Object? value
)
override

Set a field's value by fieldId. Primitive types must be "boxed" in the appropriate object wrapper type.

Implementation

setFieldValue(int fieldID, Object? value) {
  switch (fieldID) {
    case SPACE_ID:
      if (value == null) {
        unsetSpace_id();
      } else {
        this.space_id = value as int;
      }
      break;

    case PART_ID:
      if (value == null) {
        unsetPart_id();
      } else {
        this.part_id = value as int;
      }
      break;

    case EDGE_KEY:
      if (value == null) {
        unsetEdge_key();
      } else {
        this.edge_key = value as EdgeKey?;
      }
      break;

    case UPDATED_PROPS:
      if (value == null) {
        unsetUpdated_props();
      } else {
        this.updated_props = value as List<UpdatedProp>?;
      }
      break;

    case INSERTABLE:
      if (value == null) {
        unsetInsertable();
      } else {
        this.insertable = value as bool?;
      }
      break;

    case RETURN_PROPS:
      if (value == null) {
        unsetReturn_props();
      } else {
        this.return_props = value as List<Int8List>?;
      }
      break;

    case CONDITION:
      if (value == null) {
        unsetCondition();
      } else {
        this.condition = value as Int8List?;
      }
      break;

    case COMMON:
      if (value == null) {
        unsetCommon();
      } else {
        this.common = value as RequestCommon?;
      }
      break;

    default:
      throw new ArgumentError("Field $fieldID doesn't exist!");
  }
}