public class SoyMsgBundleImpl extends Object implements SoyMsgBundle
EMPTY| Constructor and Description |
|---|
SoyMsgBundleImpl(String localeString,
List<SoyMsg> msgs)
Note: If there exist duplicate message ids in the
msgs list, the first one wins. |
| Modifier and Type | Method and Description |
|---|---|
String |
getLocaleString()
Gets the language/locale string of this bundle of messages.
|
SoyMsg |
getMsg(long msgId)
Retrieves a message by its unique message id.
|
int |
getNumMsgs()
Gets the number of messages in this bundle.
|
Iterator<SoyMsg> |
iterator()
Returns an iterator over all the messages.
|
public SoyMsgBundleImpl(@Nullable String localeString, List<SoyMsg> msgs)
msgs list, the first one wins.
However, the source paths from subsequent duplicates will be added to the source paths for the
message.localeString - The language/locale string of this bundle of messages, or null if unknown.
Should only be null for bundles newly extracted from source files. Should always be set
for bundles parsed from message files/resources.msgs - The list of messages. List order will become the iteration order.public String getLocaleString()
SoyMsgBundlegetLocaleString in interface SoyMsgBundlepublic SoyMsg getMsg(long msgId)
SoyMsgBundlegetMsg in interface SoyMsgBundlemsgId - The message id of the message to retrieve.public int getNumMsgs()
SoyMsgBundlegetNumMsgs in interface SoyMsgBundlepublic Iterator<SoyMsg> iterator()
SoyMsgBundleiterator in interface SoyMsgBundleiterator in interface Iterable<SoyMsg>