fetchObject<T extends TransferObjectBase> method

T fetchObject<T extends TransferObjectBase>(
  1. ConfigPath path,
  2. TransferBean<T> bean
)

Get a config value as map and parse it into the given TransferObject.

If the value does not exist, a ConfigPathException is thrown.

If the value does not match the requested type or cannot be parsed into the given type, a ConfigTypeException is thrown.

Implementation

T fetchObject<T extends TransferObjectBase>(
    ConfigPath path, TransferBean<T> bean) {
  final map = fetch<Map<String, dynamic>>(path);
  return bean.toObject(map);
}