public class UserNotificationGenerator<M> extends Object implements org.apache.commons.collections.Transformer
Collection of UserNotifications#createNotification(Object)}| Constructor and Description |
|---|
UserNotificationGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected UserNotification<M> |
createNotification(Object m)
The input can be a Single Object or a Collection of Objects.
If the input element is a List or Array, {count String, message Object, recipient, status, severity, tags} .. |
org.apache.commons.collections.Transformer |
getSource()
A
Transformer that takes in the input and generates a raw Collection of M of Data or a Message Object |
UserNotification<M> |
getTemplate()
A template to Construct Notification messages from
|
boolean |
isReturnMultiple()
If true and the input is a Collection then each element in the input Collection is a candidate for a separate
UserNotification |
void |
setReturnMultiple(boolean returnMultiple)
If true and the input is a Collection then each element in the input Collection is a candidate for a separate
UserNotification |
void |
setSource(org.apache.commons.collections.Transformer source)
A
Transformer that takes in the input and generates a raw Collection of M of Data or a Message Object |
void |
setTemplate(UserNotification<M> template)
A template to Construct Notification messages from
|
Object |
transform(Object input)
Use the
source to convert the input into a List of UserNotifications using template as a template to fill the rest of the Notification related Data
If the input is a single entity then 1 UserNotification is returned else a Collection of UserNotifications |
protected UserNotification<M> createNotification(Object m) throws Exception
List or Array, {count String, message Object, recipient, status, severity, tags} .. rest ignored.
template.getMessage() is not null then it will set that in the resultant notification object.m - as Raw payloadUserNotificationExceptionpublic Object transform(Object input)
source to convert the input into a List of UserNotifications using template as a template to fill the rest of the Notification related Data
UserNotification is returned else a Collection of UserNotificationstransform in interface org.apache.commons.collections.TransformerUserNotification or Collection of UserNotificationspublic boolean isReturnMultiple()
UserNotificationpublic void setReturnMultiple(boolean returnMultiple)
UserNotificationpublic org.apache.commons.collections.Transformer getSource()
Transformer that takes in the input and generates a raw Collection of M of Data or a Message Objectpublic void setSource(org.apache.commons.collections.Transformer source)
Transformer that takes in the input and generates a raw Collection of M of Data or a Message Objectpublic UserNotification<M> getTemplate()
public void setTemplate(UserNotification<M> template)
Copyright © 2018. All rights reserved.