ENUM
HaapiModel.ContentFactory
Contents
- Methods
metadata(templateArea:viewName:)message(key:literal:)userMessage(text:classList:)
 
public enum ContentFactory
Provides functionality to build instances of common content.
Methods
metadata(templateArea:viewName:)
public static func metadata(templateArea: String?, viewName: String?) -> Metadata?
Creates an instance of Metadata model.
- 
Parameters:
 - 
templateArea: The value for a custom template area.
 - 
viewName: The name for the view that produced the response.
 - 
Returns: A built instance of
Metadata. If no values for the parameters are provided,nilis returned. 
message(key:literal:)
public static func message(key: String?, literal: String) -> Message
Creates an instance of Message model.
- 
Parameters:
 - 
key: A key that can be used to identify the message.
 - 
literal: The displayable message
String. - 
Returns: A built instance of
Message. 
userMessage(text:classList:)
public static func userMessage(text: Message, classList: [String]) -> UserMessage
Creates an instance of UserMessage model.
- 
Parameters:
 - 
text: The message content to be displayed..
 - 
classList: An array of Strings that represent the style classes applied to the message.
 - 
Returns: A built instance of
UserMessage.