getFieldValue method

dynamic getFieldValue(
  1. int fieldID
)
override

Get a field's value by fieldId. Primitive types will be wrapped in the appropriate "boxed" types.

Implementation

getFieldValue(int fieldID) {
  switch (fieldID) {
    case CODE:
      return this.code;
    case LEADER:
      return this.leader;
    case CLUSTER_ID:
      return this.cluster_id;
    case LAST_UPDATE_TIME_IN_MS:
      return this.last_update_time_in_ms;
    case META_VERSION:
      return this.meta_version;
    default:
      throw new ArgumentError("Field $fieldID doesn't exist!");
  }
}