Class ObjectMessage

    • Field Detail

      • objects

        private final java.util.List<FreeColObject> objects
        The attached FreeColObjects.
    • Constructor Detail

      • ObjectMessage

        public ObjectMessage​(java.lang.String type)
        Create a new ObjectMessage of a given type.
        Parameters:
        type - The message type.
      • ObjectMessage

        public ObjectMessage​(java.lang.String type,
                             java.lang.String... attributes)
        Create a new ObjectMessage of a given type, with attributes and optional objects.
        Parameters:
        type - The message type.
        attributes - A list of key,value pairs.
      • ObjectMessage

        protected ObjectMessage​(java.lang.String type,
                                FreeColXMLReader xr,
                                java.lang.String... attributes)
        Create a new AttributeMessage from a stream.
        Parameters:
        type - The message type.
        xr - The FreeColXMLReader to read from.
        attributes - The attributes to read.
    • Method Detail

      • getChildCount

        protected int getChildCount()
        Get the number of child objects.
        Overrides:
        getChildCount in class TrivialMessage
        Returns:
        The child count.
      • getChildren

        protected java.util.List<FreeColObject> getChildren()
        Get the child objects of this message.
        Overrides:
        getChildren in class TrivialMessage
        Returns:
        A list of child FreeColObjects.
      • setChildren

        protected void setChildren​(java.util.List<? extends FreeColObject> fcos)
        Set the list of objects attached to this message.
        Overrides:
        setChildren in class TrivialMessage
        Parameters:
        fcos - The new list of attached FreeColObjects.
      • appendChild

        protected <T extends FreeColObject> void appendChild​(T fco)
        Append a new child.
        Overrides:
        appendChild in class TrivialMessage
        Type Parameters:
        T - The child type.
        Parameters:
        fco - The new child object.
      • appendChildren

        protected <T extends FreeColObject> void appendChildren​(java.util.Collection<T> fcos)
        Append a multiple new children.
        Overrides:
        appendChildren in class TrivialMessage
        Type Parameters:
        T - The child type.
        Parameters:
        fcos - The new child objects.