Class RootUIComponent

  • All Implemented Interfaces:
    Identifiable<String>

    @NonNullByDefault
    public class RootUIComponent
    extends UIComponent
    implements Identifiable<String>
    A root component is a special type of Component at the root of the hierarchy. It has a number of specific parameters, a set of tags, a timestamp, some configurable parameters ("props") and is identifiable by its UID (generally a GUID).
    Author:
    Yannick Schaus - Initial contribution
    • Constructor Detail

      • RootUIComponent

        public RootUIComponent​(String name)
        Constructs a root component.
        Parameters:
        name - the name of the UI component to render the card on client frontends, ie. "HbCard"
      • RootUIComponent

        public RootUIComponent​(String uid,
                               String name)
        Constructs a root component with a specific UID.
        Parameters:
        uid - the UID of the new card
        name - the name of the UI component to render the card on client frontends, ie. "HbCard"
    • Method Detail

      • getTags

        public Set<String> getTags()
        Gets the set of tags attached to the component
        Returns:
        the card tags
      • getTimestamp

        public @Nullable Date getTimestamp()
        Gets the timestamp of the component
        Returns:
        the timestamp
      • setTimestamp

        public void setTimestamp​(Date date)
        Sets the specified timestamp of the component
        Parameters:
        date - the timestamp
      • updateTimestamp

        public void updateTimestamp()
        Updates the timestamp of the component to the current date & time.
      • hasTag

        public boolean hasTag​(String tag)
        Returns whether the component has a certain tag
        Parameters:
        tag - the tag to check
        Returns:
        true if the component is tagged with the specified tag
      • addTag

        public void addTag​(String tag)
        Adds a tag to the component
        Parameters:
        tag - the tag to add
      • addTags

        public void addTags​(Collection<String> tags)
        Adds several tags to the component
        Parameters:
        tags - the tags to add
      • addTags

        public void addTags​(String... tags)
        Adds several tags to the component
        Parameters:
        tags - the tags to add
      • removeTag

        public void removeTag​(String tag)
        Removes a tag on a component
        Parameters:
        tag - the tag to remove
      • removeAllTags

        public void removeAllTags()
        Removes all tags on the component
      • getProps

        public ConfigDescriptionDTO getProps()
        Gets the configurable parameters ("props") of the component
        Returns:
        the configurable parameters
      • setProps

        public void setProps​(ConfigDescriptionDTO props)
        Sets the configurable parameters ("props") of the component
        Parameters:
        props - the configurable parameters