Class HashMapMessage

    • Constructor Detail

      • HashMapMessage

        public HashMapMessage()
      • HashMapMessage

        public HashMapMessage​(Message message)
    • Method Detail

      • getChannel

        public String getChannel()
        Description copied from interface: Message
        Convenience method to retrieve the Message.CHANNEL_FIELD. Bayeux message always have a non null channel.
        Specified by:
        getChannel in interface Message
        Returns:
        the channel of the message
      • getChannelId

        public ChannelId getChannelId()
        Description copied from interface: Message
        Convenience method to retrieve the Message.CHANNEL_FIELD. Bayeux message always have a non null channel.
        Specified by:
        getChannelId in interface Message
        Returns:
        the channel of the message
      • getJSON

        public String getJSON()
        Specified by:
        getJSON in interface Message
        Returns:
        this message as a JSON string
      • getAdvice

        public Map<String,​Object> getAdvice​(boolean create)
        Description copied from interface: Message.Mutable
        Convenience method to retrieve the Message.ADVICE_FIELD and create it if it does not exist
        Specified by:
        getAdvice in interface Message.Mutable
        Parameters:
        create - whether to create the advice field if it does not exist
        Returns:
        the advice of the message
      • getDataAsMap

        public Map<String,​Object> getDataAsMap​(boolean create)
        Description copied from interface: Message.Mutable
        Convenience method to retrieve the Message.DATA_FIELD and create it if it does not exist
        Specified by:
        getDataAsMap in interface Message.Mutable
        Parameters:
        create - whether to create the data field if it does not exist
        Returns:
        the data of the message
      • getExt

        public Map<String,​Object> getExt​(boolean create)
        Description copied from interface: Message.Mutable
        Convenience method to retrieve the Message.EXT_FIELD and create it if it does not exist
        Specified by:
        getExt in interface Message.Mutable
        Parameters:
        create - whether to create the ext field if it does not exist
        Returns:
        the ext of the message
      • isMeta

        public boolean isMeta()
        Description copied from interface: Message
        A messages that has a meta channel is dubbed a "meta message".
        Specified by:
        isMeta in interface Message
        Returns:
        whether the channel's message is a meta channel
      • isPublishReply

        public boolean isPublishReply()
        Description copied from interface: Message
        Publish message replies contain the "successful" field
        Specified by:
        isPublishReply in interface Message
        Returns:
        whether this message is a publish reply (as opposed to a published message)
      • setChannel

        public void setChannel​(String channel)
        Specified by:
        setChannel in interface Message.Mutable
        Parameters:
        channel - the channel of this message
      • setClientId

        public void setClientId​(String clientId)
        Specified by:
        setClientId in interface Message.Mutable
        Parameters:
        clientId - the client id of this message
      • setData

        public void setData​(Object data)
        Specified by:
        setData in interface Message.Mutable
        Parameters:
        data - the data of this message
      • setId

        public void setId​(String id)
        Specified by:
        setId in interface Message.Mutable
        Parameters:
        id - the id of this message
      • setSuccessful

        public void setSuccessful​(boolean successful)
        Specified by:
        setSuccessful in interface Message.Mutable
        Parameters:
        successful - the successfulness of this message