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 EDGE_TYPES:
      if (value == null) {
        unsetEdge_types();
      } else {
        this.edge_types = value as List<int>;
      }
      break;

    case EDGE_DIRECTION:
      if (value == null) {
        unsetEdge_direction();
      } else {
        this.edge_direction = value as int;
      }
      break;

    case DEDUP:
      if (value == null) {
        unsetDedup();
      } else {
        this.dedup = value as bool;
      }
      break;

    case STAT_PROPS:
      if (value == null) {
        unsetStat_props();
      } else {
        this.stat_props = value as List<StatProp>;
      }
      break;

    case VERTEX_PROPS:
      if (value == null) {
        unsetVertex_props();
      } else {
        this.vertex_props = value as List<VertexProp>;
      }
      break;

    case EDGE_PROPS:
      if (value == null) {
        unsetEdge_props();
      } else {
        this.edge_props = value as List<EdgeProp>;
      }
      break;

    case EXPRESSIONS:
      if (value == null) {
        unsetExpressions();
      } else {
        this.expressions = value as List<Expr>;
      }
      break;

    case ORDER_BY:
      if (value == null) {
        unsetOrder_by();
      } else {
        this.order_by = value as List<OrderBy>;
      }
      break;

    case RANDOM:
      if (value == null) {
        unsetRandom();
      } else {
        this.random = value as bool;
      }
      break;

    case LIMIT:
      if (value == null) {
        unsetLimit();
      } else {
        this.limit = value as int;
      }
      break;

    case FILTER:
      if (value == null) {
        unsetFilter();
      } else {
        this.filter = value as Int8List;
      }
      break;

    case TAG_FILTER:
      if (value == null) {
        unsetTag_filter();
      } else {
        this.tag_filter = value as Int8List;
      }
      break;

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