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:
parent
587f5a7bf7
commit
c0958b58e4
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user