Package pl.edu.icm.unity.types.basic
Class MessageTemplate
java.lang.Object
pl.edu.icm.unity.types.DescribedObjectROImpl
pl.edu.icm.unity.types.DescribedObjectImpl
pl.edu.icm.unity.types.basic.MessageTemplate
- All Implemented Interfaces:
DescribedObject
,NamedObject
Wraps notification message template. It consist of text, subject, supports localization.
What is most important it handles parameter substitution.
Implementation note: this will be extended in future: based on freemarker, message metadata (as use HTML) added etc. For now is simplistic.
The syntax: all '${foo}' expressions are replaced by the value of the foo key.
- Author:
- K. Benedyczak
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Objects are used to interchange resolved messages, with substituted parameters and fixed locale. -
Field Summary
Fields inherited from class pl.edu.icm.unity.types.DescribedObjectROImpl
description, name
-
Constructor Summary
ConstructorDescriptionMessageTemplate
(com.fasterxml.jackson.databind.node.ObjectNode root) MessageTemplate
(String name, String description, I18nMessage message, String consumer, MessageType type, String notificationChannel) -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
getType()
int
hashCode()
void
setConsumer
(String consumer) void
setMessage
(I18nMessage message) void
setNotificationChannel
(String notificationChannel) void
setType
(MessageType type) com.fasterxml.jackson.databind.node.ObjectNode
toJson()
toString()
Methods inherited from class pl.edu.icm.unity.types.DescribedObjectImpl
setDescription, setName
Methods inherited from class pl.edu.icm.unity.types.DescribedObjectROImpl
fromJsonDescObj, getDescription, getName
-
Constructor Details
-
MessageTemplate
public MessageTemplate() -
MessageTemplate
public MessageTemplate(String name, String description, I18nMessage message, String consumer, MessageType type, String notificationChannel) -
MessageTemplate
public MessageTemplate(com.fasterxml.jackson.databind.node.ObjectNode root)
-
-
Method Details
-
toJson
public com.fasterxml.jackson.databind.node.ObjectNode toJson()- Overrides:
toJson
in classDescribedObjectROImpl
-
setConsumer
-
getConsumer
-
getType
-
setType
-
getNotificationChannel
-
setNotificationChannel
-
getMessage
-
setMessage
-
clone
-
toString
- Overrides:
toString
in classDescribedObjectROImpl
-
equals
- Overrides:
equals
in classDescribedObjectROImpl
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDescribedObjectROImpl
-