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
public class MessageTemplate extends DescribedObjectImpl
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
Nested Classes Modifier and Type Class Description static class
MessageTemplate.Message
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
Constructors Constructor Description MessageTemplate()
MessageTemplate(com.fasterxml.jackson.databind.node.ObjectNode root)
MessageTemplate(String name, String description, I18nMessage message, String consumer, MessageType type, String notificationChannel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageTemplate
clone()
boolean
equals(Object other)
String
getConsumer()
I18nMessage
getMessage()
String
getNotificationChannel()
MessageType
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()
String
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 Detail
-
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 Detail
-
toJson
public com.fasterxml.jackson.databind.node.ObjectNode toJson()
- Overrides:
toJson
in classDescribedObjectROImpl
-
setConsumer
public void setConsumer(String consumer)
-
getConsumer
public String getConsumer()
-
getType
public MessageType getType()
-
setType
public void setType(MessageType type)
-
getNotificationChannel
public String getNotificationChannel()
-
setNotificationChannel
public void setNotificationChannel(String notificationChannel)
-
getMessage
public I18nMessage getMessage()
-
setMessage
public void setMessage(I18nMessage message)
-
clone
public MessageTemplate clone()
-
toString
public String toString()
- Overrides:
toString
in classDescribedObjectROImpl
-
equals
public boolean equals(Object other)
- Overrides:
equals
in classDescribedObjectROImpl
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDescribedObjectROImpl
-
-