added getHandlerType for a Type

refactored existing getHandler to call this new method

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2021-10-27 14:53:55 -05:00
parent 587f5a7bf7
commit c0958b58e4

View File

@ -165,8 +165,11 @@ public struct ModelRegistry {
//--------------------------------------------------
public static func getHandler(_ model: ModelProtocol) throws -> ModelHandlerProtocol.Type {
// Get the modelType
let modelType = type(of: model)
return try getHandlerType(for: type(of: model))
}
//get handler for the specific Model
public static func getHandlerType(for modelType: ModelProtocol.Type) throws -> ModelHandlerProtocol.Type{
// Get the category for the ModelProtocol
guard let category = categories[modelType.categoryName] else {