Class ChatEvent


  • public class ChatEvent
    extends java.lang.Object
    Information about some event that happened in the chat component.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IComponentIdentifier cid
      The user cid.
      protected byte[] image
      The image.
      protected java.lang.String nick
      The nick name.
      protected boolean privatemessage
      Flag for privat message.
      protected java.lang.String type
      The event type.
      static java.lang.String TYPE_FILE
      Event type for a received file (value is file info, nick only available for initial file events).
      static java.lang.String TYPE_MESSAGE
      Event type for a received message (value is message text).
      static java.lang.String TYPE_STATECHANGE
      Event type for a chat user status change (value is user state).
      protected java.lang.Object value
      The event value (depends on type).
    • Constructor Summary

      Constructors 
      Constructor Description
      ChatEvent()
      Create a new chat event.
      ChatEvent​(java.lang.String type, java.lang.String nick, IComponentIdentifier cid, java.lang.Object value, boolean privatemessage, byte[] image)
      Create a new chat event.
    • Field Detail

      • TYPE_STATECHANGE

        public static final java.lang.String TYPE_STATECHANGE
        Event type for a chat user status change (value is user state).
        See Also:
        Constant Field Values
      • TYPE_MESSAGE

        public static final java.lang.String TYPE_MESSAGE
        Event type for a received message (value is message text).
        See Also:
        Constant Field Values
      • TYPE_FILE

        public static final java.lang.String TYPE_FILE
        Event type for a received file (value is file info, nick only available for initial file events).
        See Also:
        Constant Field Values
      • type

        protected java.lang.String type
        The event type.
      • nick

        protected java.lang.String nick
        The nick name.
      • value

        protected java.lang.Object value
        The event value (depends on type).
      • privatemessage

        protected boolean privatemessage
        Flag for privat message.
      • image

        protected byte[] image
        The image.
    • Constructor Detail

      • ChatEvent

        public ChatEvent()
        Create a new chat event.
      • ChatEvent

        public ChatEvent​(java.lang.String type,
                         java.lang.String nick,
                         IComponentIdentifier cid,
                         java.lang.Object value,
                         boolean privatemessage,
                         byte[] image)
        Create a new chat event.
    • Method Detail

      • getType

        public java.lang.String getType()
        Get the type.
      • getNick

        public java.lang.String getNick()
        Get the nick name.
      • getValue

        public java.lang.Object getValue()
        Get the value.
      • setType

        public void setType​(java.lang.String type)
        Set the type.
      • setNick

        public void setNick​(java.lang.String nick)
        Set the nick name.
      • setComponentIdentifier

        public void setComponentIdentifier​(IComponentIdentifier cid)
        Set the cid.
      • setValue

        public void setValue​(java.lang.Object value)
        Set the value.
      • isPrivateMessage

        public boolean isPrivateMessage()
        Get the privatemessage.
        Returns:
        the privatemessage.
      • setPrivateMessage

        public void setPrivateMessage​(boolean privatemessage)
        Set the privatemessage.
        Parameters:
        privatemessage - The privatemessage to set.
      • getImage

        public byte[] getImage()
        Get the image.
        Returns:
        the image.
      • setImage

        public void setImage​(byte[] image)
        Set the image.
        Parameters:
        image - The image to set.
      • toString

        public java.lang.String toString()
        Get a string representation.
        Overrides:
        toString in class java.lang.Object