Class MessageTemplate1<PARAM_1>
java.lang.Object
dk.cloudcreate.essentials.shared.messages.AbstractMessageTemplate
dk.cloudcreate.essentials.shared.messages.MessageTemplate1<PARAM_1>
- All Implemented Interfaces:
MessageTemplate
Represents a
Example defining a
MessageTemplate accepting 1 parameterExample defining a
MessageTemplate1's:
// Has key: "ESSENTIALS"
MessageTemplate0 ROOT = MessageTemplates.root("ESSENTIALS");
// Has key: "ESSENTIALS.ACCOUNT_NOT_FOUND"
MessageTemplate1<String> ACCOUNT_NOT_FOUND = ROOT.key1("ACCOUNT_NOT_FOUND",
"Account {0} not found");
Example creating a Message from a MessageTemplate1:
MessageTemplate1<String> ACCOUNT_NOT_FOUND = ROOT.key1("ACCOUNT_NOT_FOUND",
"Account {0} not found");
Message msg = ACCOUNT_NOT_FOUND.create(accountId);
-
Field Summary
Fields inherited from class dk.cloudcreate.essentials.shared.messages.AbstractMessageTemplate
defaultMessage, key -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate aMessage, with the provided parameter, based on thisMessageTemplate
Example creating aMessagefrom aMessageTemplate1:Methods inherited from class dk.cloudcreate.essentials.shared.messages.AbstractMessageTemplate
equals, getDefaultMessage, getKey, hashCode, toString
-
Constructor Details
-
MessageTemplate1
-
-
Method Details
-
create
Create aMessage, with the provided parameter, based on thisMessageTemplate
Example creating aMessagefrom aMessageTemplate1:MessageTemplate1<String> ACCOUNT_NOT_FOUND = ROOT.key1("ACCOUNT_NOT_FOUND", "Account {0} not found"); Message msg = ACCOUNT_NOT_FOUND.create(accountId);- Parameters:
param1- the parameter with index 0 in the generatedMessage.getMessage()- Returns:
- the new
Messagewith the parameter applied
-