Class Label

    • Method Detail

      • getOwner

        @Deprecated
        public @Nullable String getOwner()
        Deprecated.
        since 5.2. See getOwnerUser() instead.
        Returns:
        the username of the owner of this label.
      • getOwnerUser

        public @Nullable ConfluenceUser getOwnerUser()
        Since:
        5.2
      • getNamespace

        public Namespace getNamespace()
      • equals

        public boolean equals​(Object o)
        Equals implementation is a value based implementation. It does not take into account the 'persistence' state of this label instance.
        Overrides:
        equals in class com.atlassian.core.bean.EntityObject
        Returns:
        true if the specified object is considered value equivalent.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.atlassian.core.bean.EntityObject
      • getDisplayTitle

        public String getDisplayTitle()
        Specified by:
        getDisplayTitle in interface Addressable
        Returns:
        the title of the addressable object, suitable for display in a list
      • isRealTitleSafeForUrl

        public boolean isRealTitleSafeForUrl()
        Description copied from interface: DisplayableLabel
        Returns true if the label's title is safe to pass in the URL.

        eg. my:foo is safe, perc% is not safe. chicken+cheese is safe in a "combined" label.

        Specified by:
        isRealTitleSafeForUrl in interface DisplayableLabel
        Returns:
        true if the label's title is safe to pass in the URL.
      • isNew

        @Deprecated
        public boolean isNew()
        Deprecated.
        since Confluence 5.1, do not use.
        Deprecated since Confluence 5.1 because this method does not seem to do anything useful.

        Can not find a way to edit a label in Confluence, so getCreationDate() and getLastModificationDate() seem to always be equal, so this method will likely always return true.

        Lack of documentation and seemingly no usage (in Confluence) indicates this method can be removed.

      • isPersistent

        public boolean isPersistent()
        This label is persistent iff the id is not 0.
        Returns:
        true if this instance is a persisted label.
      • isVisibleTo

        public boolean isVisibleTo​(@Nullable String username)
        Determines whether the label should be made visible to a particular user. This does not check the permissions on labelled content, you will need to do that separately
        Parameters:
        username - the username of the user who wishes to see the label
        Returns:
        true if the user is permitted to see it, false otherwise
      • toStringWithOwnerPrefix

        public String toStringWithOwnerPrefix()
      • toStringWithNamespace

        public String toStringWithNamespace()
      • isTeamLabel

        public boolean isTeamLabel()