useAdapter method

JsonMapper useAdapter (
  1. IAdapter adapter,
  2. [int priority]
)

Implementation

JsonMapper useAdapter(IAdapter adapter, [int priority]) {
  final nextPriority = priority ?? adapters.keys.isNotEmpty
      ? adapters.keys.reduce((value, item) => max(value, item)) + 1
      : 0;
  adapters[nextPriority] = adapter;
  return this;
}