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 SESSION_ID:
      if (value == null) {
        unsetSession_id();
      } else {
        this.session_id = value as int;
      }
      break;

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

    case UPDATE_TIME:
      if (value == null) {
        unsetUpdate_time();
      } else {
        this.update_time = value as int;
      }
      break;

    case USER_NAME:
      if (value == null) {
        unsetUser_name();
      } else {
        this.user_name = value as Int8List?;
      }
      break;

    case SPACE_NAME:
      if (value == null) {
        unsetSpace_name();
      } else {
        this.space_name = value as Int8List?;
      }
      break;

    case GRAPH_ADDR:
      if (value == null) {
        unsetGraph_addr();
      } else {
        this.graph_addr = value as t_nebula.HostAddr?;
      }
      break;

    case TIMEZONE:
      if (value == null) {
        unsetTimezone();
      } else {
        this.timezone = value as int;
      }
      break;

    case CLIENT_IP:
      if (value == null) {
        unsetClient_ip();
      } else {
        this.client_ip = value as Int8List?;
      }
      break;

    case CONFIGS:
      if (value == null) {
        unsetConfigs();
      } else {
        this.configs = value as Map<Int8List, t_nebula.Value>?;
      }
      break;

    case QUERIES:
      if (value == null) {
        unsetQueries();
      } else {
        this.queries = value as Map<int, QueryDesc>?;
      }
      break;

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