public <T> T produceModel(Class<T> type, ConsumerOperationParameters operationParameters) {
if (!versionDetails.maySupportModel(type)) {
throw Exceptions.unsupportedModel(type, versionDetails.getVersion());
}
final ModelIdentifier modelIdentifier = modelMapping.getModelIdentifierFromModelType(type);
BuildResult<?> result;
try {
result = builder.getModel(modelIdentifier, new BuildCancellationTokenAdapter(operationParameters.getCancellationToken()), operationParameters);
} catch (InternalUnsupportedModelException e) {
throw Exceptions.unknownModel(type, e);