execute method

T? execute()

Implementation

T? execute() {
  if (databaseMiniMethodType == DatabaseMiniMethodType.getDatabase) {
    // unsupported
    // {
    //   final ClassMirror classMirror = reflectClass(T);
    //   if (classMirror.isAssignableTo(reflectType(JsonScheme))) {
    //     final T result = (classMirror.invoke(Symbol("empty"), []).reflectee as T);
    //     if (result is JsonScheme) {
    //       final Map? result_data = db.stateData.extension_general_lib_getData(key: state_key);
    //       if (result_data == null) {
    //         return null;
    //       }
    //       result.rawData = result_data;
    //     }
    //     return result;
    //   }
    // }
    {
      final result_data =
          db.stateData.extension_general_lib_getData(key: state_key);
      if (result_data == null) {
        return null;
      }
      return result_data as T;
    }
  }

  if (databaseMiniMethodType == DatabaseMiniMethodType.setDatabase) {
    db.stateData.utils_set_data_void(
      state_key,
      anyValueToWriteableJson(state_value),
    );
    return true as T;
  }

  throw UnimplementedError(databaseMiniMethodType.name);
}