addType static method

void addType(
  1. Type type,
  2. BsonConstructor constructor,
  3. int uniqueId
)

Implementation

static void addType(Type type, BsonConstructor constructor, int uniqueId) {
  if (_repository.containsKey(type)) {
    throw ArgumentError(
        'Type $type already defined in the Object repository');
  }
  _repository[type] = constructor;
  if (_repositoryId.containsKey(uniqueId)) {
    throw ArgumentError('UniqueId $uniqueId already defined '
        'for Type "${_repositoryId[uniqueId]}"');
  }
  _repositoryId[uniqueId] = type;
  _repositoryType[type] = uniqueId;
}