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 NAME:
      if (value == null) {
        unsetName();
      } else {
        this.name = value as Int8List;
      }
      break;

    case ID:
      if (value == null) {
        unsetId();
      } else {
        this.id = value as int;
      }
      break;

    case OUTPUT_VAR:
      if (value == null) {
        unsetOutput_var();
      } else {
        this.output_var = value as Int8List;
      }
      break;

    case DESCRIPTION:
      if (value == null) {
        unsetDescription();
      } else {
        this.description = value as List<Pair>;
      }
      break;

    case PROFILES:
      if (value == null) {
        unsetProfiles();
      } else {
        this.profiles = value as List<ProfilingStats>;
      }
      break;

    case BRANCH_INFO:
      if (value == null) {
        unsetBranch_info();
      } else {
        this.branch_info = value as PlanNodeBranchInfo;
      }
      break;

    case DEPENDENCIES:
      if (value == null) {
        unsetDependencies();
      } else {
        this.dependencies = value as List<int>;
      }
      break;

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