public class SoyMsgIdComputer extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
computeMsgId(com.google.common.collect.ImmutableList<SoyMsgPart> msgParts,
String meaning,
String contentType)
Computes the unique message id for a message, given the message parts, the meaning string (if
any), and the content type (if any).
|
static long |
computeMsgIdUsingBracedPhs(com.google.common.collect.ImmutableList<SoyMsgPart> msgParts,
String meaning,
String contentType)
Computes an alternate unique message id for a message, given the message parts, the meaning
string (if any), and the content type (if any).
|
public static long computeMsgId(com.google.common.collect.ImmutableList<SoyMsgPart> msgParts, @Nullable String meaning, @Nullable String contentType)
In particular, note that the id of a message does not change when its desc changes.
msgParts - The parts of the message.meaning - The meaning string, or null if none (usually null).contentType - Content type of the document that this message will appear in (e.g.
"text/html", or null if not used.public static long computeMsgIdUsingBracedPhs(com.google.common.collect.ImmutableList<SoyMsgPart> msgParts, @Nullable String meaning, @Nullable String contentType)
In particular, note that the id of a message does not change when its desc changes.
Important: This is an alternate message id computation using braced placeholders. Only use
this function instead of computeMsgId(com.google.common.collect.ImmutableList<com.google.template.soy.msgs.restricted.SoyMsgPart>, java.lang.String, java.lang.String) if you know that you need this alternate format.
msgParts - The parts of the message.meaning - The meaning string, or null if none (usually null).contentType - Content type of the document that this message will appear in (e.g.
"text/html", or null if not used..