Class EmptyMessageBundle

  • All Implemented Interfaces:
    MessageBundle

    public final class EmptyMessageBundle
    extends java.lang.Object
    implements MessageBundle
    An implementation of MessageBundle that has no translations.
    • Constructor Detail

      • EmptyMessageBundle

        public EmptyMessageBundle()
    • Method Detail

      • idGenerator

        public JsMessage.IdGenerator idGenerator()
        Gets a dummy message ID generator.
        Specified by:
        idGenerator in interface MessageBundle
        Returns:
        idGenerator instance or null if we do not want to use any custom id generation. In case if idGenerator is null caller should decide how to create id by itself. In the most cases using the message key is enough.
      • getMessage

        public JsMessage getMessage​(java.lang.String id)
        Returns null, to indicate it has no message replacements.
        Specified by:
        getMessage in interface MessageBundle
        Parameters:
        id - the id of the message being replaced; the key is message ID generated by JsMessage.IdGenerator
        Returns:
        the message replacement, which may be null.
      • getAllMessages

        public com.google.common.collect.ImmutableList<JsMessage> getAllMessages()
        Returns an empty list of messages.
        Specified by:
        getAllMessages in interface MessageBundle
        Returns:
        all messages from this bundle.