How about checking here for the following conditions:

  - `numFields == -1 && this.classes != null`  --> Types via parameters. Good!
  - `numFields > 0 && this.classes == null` --> Types via config object. Good!
  - `numFields == -1 && this.classes == null` --> Neither of both, error!
  - `numFields >0 && this.classes != null` --> Both at the same time, error!

This would also not silently ignore the config, is the parameters are set.