Class Label

    • Method Detail

      • getOwner

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

        public @Nullable ConfluenceUser getOwnerUser()
      • 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.
        equals in class com.atlassian.core.bean.EntityObject
        true if the specified object is considered value equivalent.
      • hashCode

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

        public String getDisplayTitle()
        Specified by:
        getDisplayTitle in interface Addressable
        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
        true if the label's title is safe to pass in the URL.
      • isNew

        public boolean isNew()
        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.
        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
        username - the username of the user who wishes to see the label
        true if the user is permitted to see it, false otherwise
      • toStringWithOwnerPrefix

        public String toStringWithOwnerPrefix()
      • toStringWithNamespace

        public String toStringWithNamespace()
      • isTeamLabel

        public boolean isTeamLabel()