Class GroupItem

    • Method Detail

      • getBaseItem

        public GenericItem getBaseItem()
        Returns the base item of this GroupItem. This method is only intended to allow instance checks of the underlying BaseItem. It must not be changed in any way.
        Returns:
        the base item of this GroupItem
      • getMembers

        public List<Item> getMembers()
        Returns the direct members of this GroupItem regardless if these members are GroupItems as well.
        Returns:
        the direct members of this GroupItem
      • getAllMembers

        public List<Item> getAllMembers()
        Returns the direct members of this GroupItem and recursively all members of the potentially contained GroupItems as well. The GroupItems itself aren't contained. The returned items are unique.
        Returns:
        all members of this and all contained GroupItems
      • addMember

        public void addMember​(Item item)
      • removeMember

        public void removeMember​(Item item)
      • getAcceptedDataTypes

        public List<Class<? extends State>> getAcceptedDataTypes()
        The accepted data types of a group item is the same as of the underlying base item. If none is defined, the intersection of all sets of accepted data types of all group members is used instead.
        Specified by:
        getAcceptedDataTypes in interface Item
        Returns:
        the accepted data types of this group item
      • getAcceptedCommandTypes

        public List<Class<? extends Command>> getAcceptedCommandTypes()
        The accepted command types of a group item is the same as of the underlying base item. If none is defined, the intersection of all sets of accepted command types of all group members is used instead.
        Specified by:
        getAcceptedCommandTypes in interface Item
        Returns:
        the accepted command types of this group item
      • send

        public void send​(Command command)
      • getStateAs

        public State getStateAs​(Class<? extends State> typeClass)
        Description copied from interface: Item
        returns the current state of the item as a specific type
        Specified by:
        getStateAs in interface Item
        Overrides:
        getStateAs in class GenericItem
        Returns:
        the current state in the requested type or null, if state cannot be provided as the requested type
      • stateChanged

        public void stateChanged​(Item item,
                                 State oldState,
                                 State newState)
        Description copied from interface: StateChangeListener
        This method is called, if a state has changed.
        Specified by:
        stateChanged in interface StateChangeListener
        Parameters:
        item - the item whose state has changed
        oldState - the previous state
        newState - the new state
      • stateUpdated

        public void stateUpdated​(Item item,
                                 State state)
        Description copied from interface: StateChangeListener
        This method is called, if a state was updated, but has not changed
        Specified by:
        stateUpdated in interface StateChangeListener
        Parameters:
        item - the item whose state was updated
        state - the current state, same before and after the update