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_BACKUPS:
      if (value == null) {
        unsetSpace_backups();
      } else {
        this.space_backups = value as Map<int, SpaceBackupInfo>;
      }
      break;

    case META_FILES:
      if (value == null) {
        unsetMeta_files();
      } else {
        this.meta_files = value as List<Int8List>;
      }
      break;

    case BACKUP_NAME:
      if (value == null) {
        unsetBackup_name();
      } else {
        this.backup_name = value as Int8List;
      }
      break;

    case FULL:
      if (value == null) {
        unsetFull();
      } else {
        this.full = value as bool;
      }
      break;

    case ALL_SPACES:
      if (value == null) {
        unsetAll_spaces();
      } else {
        this.all_spaces = value as bool;
      }
      break;

    case CREATE_TIME:
      if (value == null) {
        unsetCreate_time();
      } else {
        this.create_time = value as int;
      }
      break;

    case BASE_BACKUP_NAME:
      if (value == null) {
        unsetBase_backup_name();
      } else {
        this.base_backup_name = value as Int8List;
      }
      break;

    case STORAGE_HOSTS:
      if (value == null) {
        unsetStorage_hosts();
      } else {
        this.storage_hosts = value as List<t_nebula.HostAddr>;
      }
      break;

    case CLUSTER_ID:
      if (value == null) {
        unsetCluster_id();
      } else {
        this.cluster_id = value as int;
      }
      break;

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