Package com.atlassian.confluence.labels
Class Label
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.AnnotatedEntityObject
com.atlassian.confluence.labels.Label
- All Implemented Interfaces:
DisplayableLabel,Serializable,Cloneable,Comparable<Label>
@Entity
public class Label
extends AnnotatedEntityObject
implements Comparable<Label>, Serializable, DisplayableLabel
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic booleancontainsFavouriteLabel(Collection<Label> labels, ConfluenceUser user) booleanEquals implementation is a value based implementation.Deprecated, for removal: This API element is subject to removal in a future version.longgetId()getName()Returns the label's name only.@Nullable StringgetOwner()Deprecated.since 5.2.@Nullable ConfluenceUserDeprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getRealTitle()getType()Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 unusedDeprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getUrlPath()getUrlPath(String spaceKey) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getUrlPath(String)inthashCode()booleanisNew()Deprecated.since Confluence 5.1, do not use.booleanThis label is persistent iff the id is not 0.booleanDeprecated, for removal: This API element is subject to removal in a future version.since 9.3 unusedbooleanbooleanisVisibleTo(@Nullable String username) Determines whether the label should be made visible to a particular user.toString()Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useLabelParser.renderWithNamespace(Label)Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useLabelParser.renderWithOwnerPrefix(Label)Methods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObject
clone, getCurrentDate, setClock, setCreationDate, setId, setLastModificationDate
-
Constructor Details
-
Label
public Label() -
Label
-
Label
-
Label
-
Label
-
Label
-
-
Method Details
-
getId
public long getId()- Overrides:
getIdin classcom.atlassian.core.bean.EntityObject
-
getName
Description copied from interface:DisplayableLabelReturns the label's name only.eg. label name for label my:foo is "foo".
- Specified by:
getNamein interfaceDisplayableLabel
-
getOwner
Deprecated.since 5.2. SeegetOwnerUser()instead.- Returns:
- the username of the owner of this label.
-
getOwnerUser
- Since:
- 5.2
-
getNamespace
-
getType
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 unused -
equals
Equals implementation is a value based implementation. It does not take into account the 'persistence' state of this label instance.- Overrides:
equalsin classcom.atlassian.core.bean.EntityObject- Returns:
- true if the specified object is considered value equivalent.
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.atlassian.core.bean.EntityObject
-
compareTo
- Specified by:
compareToin interfaceComparable<Label>
-
getRealTitle
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getRealTitle()Description copied from interface:DisplayableLabelReturn the title as a combination of the namespace and the label name.- Specified by:
getRealTitlein interfaceDisplayableLabel
-
getDisplayTitle
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getDisplayTitle()- Specified by:
getDisplayTitlein interfaceDisplayableLabel
-
isRealTitleSafeForUrl
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 unusedDescription copied from interface:DisplayableLabelReturns 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:
isRealTitleSafeForUrlin interfaceDisplayableLabel- Returns:
- true if the label's title is safe to pass in the URL.
-
getUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getUrlPath()Description copied from interface:DisplayableLabelGenerates the url path for a label.- Specified by:
getUrlPathin interfaceDisplayableLabel
-
getUrlPath
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useDisplayableLabel.getUrlPath(String)Description copied from interface:DisplayableLabelGenerates the url path for a label in the context of a given space i.e. the user is taken to a page that contains content for that space only.If no space if provided,
DisplayableLabel.getUrlPath()is called.- Specified by:
getUrlPathin interfaceDisplayableLabel
-
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
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
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useLabelParser.renderWithOwnerPrefix(Label) -
toString
-
toStringWithNamespace
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useLabelParser.renderWithNamespace(Label) -
isTeamLabel
public boolean isTeamLabel() -
containsFavouriteLabel
- Since:
- 9.3
-
DisplayableLabel.getDisplayTitle()