public class

Label

extends EntityObject
implements Addressable DisplayableLabel Serializable Comparable<T>
java.lang.Object
   ↳ com.atlassian.core.bean.EntityObject
     ↳ com.atlassian.confluence.labels.Label

Summary

Public Constructors
Label()
Label(String name)
Label(String name, Namespace namespace)
Label(String name, String namespace, String owner)
Label(String name, Namespace namespace, String owner)
Public Methods
int compareTo(Object o)
boolean equals(Object o)
Equals implementation is a value based implementation.
String getDisplayTitle()
String getName()
Returns the label's name only.
Namespace getNamespace()
String getOwner()
String getRealTitle()
Return the title as a combination of the namespace and the label name.
String getType()
String getUrlPath()
Generates the url path for a label.
String getUrlPath(String spaceKey)
Generates the url path for a label in the context of a given space i.e.
int hashCode()
boolean isNew()
boolean isPersistent()
This label is persistent iff the id is not 0.
boolean isRealTitleSafeForUrl()
Returns true if the label's title is safe to pass in the URL.
boolean isTeamLabel()
boolean isVisibleTo(String username)
Determines whether the label should be made visible to a particular user.
String toString()
String toStringWithNamespace()
String toStringWithOwnerPrefix()
[Expand]
Inherited Methods
From class com.atlassian.core.bean.EntityObject
From class java.lang.Object
From interface com.atlassian.confluence.core.Addressable
From interface com.atlassian.confluence.core.ContentTypeAware
From interface com.atlassian.confluence.labels.DisplayableLabel
From interface java.lang.Comparable

Public Constructors

public Label ()

public Label (String name)

public Label (String name, Namespace namespace)

public Label (String name, String namespace, String owner)

public Label (String name, Namespace namespace, String owner)

Public Methods

public int compareTo (Object o)

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.

Returns
  • true if the specified object is considered value equivalent.

public String getDisplayTitle ()

public String getName ()

Returns the label's name only.

eg. label name for label my:foo is "foo".

public Namespace getNamespace ()

public String getOwner ()

public String getRealTitle ()

Return the title as a combination of the namespace and the label name.

public String getType ()

public String getUrlPath ()

Generates the url path for a label.

public String getUrlPath (String spaceKey)

Generates 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, getUrlPath() is called.

public int hashCode ()

public boolean isNew ()

public boolean isPersistent ()

This label is persistent iff the id is not 0.

Returns
  • true if this instance is a persisted label.

public boolean isRealTitleSafeForUrl ()

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.

Returns
  • true if the label's title is safe to pass in the URL.

public boolean isTeamLabel ()

public boolean isVisibleTo (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

public String toString ()

public String toStringWithNamespace ()

public String toStringWithOwnerPrefix ()