public class Label extends com.atlassian.core.bean.EntityObject implements Comparable<Label>, Addressable, Serializable, DisplayableLabel
Constructor and Description |
---|
Label() |
Label(String name) |
Label(String name,
Namespace namespace) |
Label(String name,
Namespace namespace,
ConfluenceUser owner) |
Label(String name,
Namespace namespace,
String owner)
Deprecated.
since 5.2.
|
Label(String name,
String namespace) |
Label(String name,
String namespace,
ConfluenceUser owner) |
Label(String name,
String namespace,
String owner)
Deprecated.
since 5.2. Use
Label(String, Namespace, com.atlassian.confluence.user.ConfluenceUser)
instead. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Label otherlabel) |
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()
Deprecated.
since 5.2. See
getOwnerUser() instead. |
ConfluenceUser |
getOwnerUser() |
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()
Deprecated.
since Confluence 5.1, do not use.
|
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() |
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
finalize, getClass, notify, notifyAll, wait, wait, wait
getId
public Label()
public Label(String name)
public Label(String name, String namespace, ConfluenceUser owner)
@Deprecated public Label(String name, String namespace, String owner)
Label(String, Namespace, com.atlassian.confluence.user.ConfluenceUser)
instead.@Deprecated public Label(String name, Namespace namespace, String owner)
name
- namespace
- owner
- username of the owner of this label.IllegalArgumentException
- if the username supplied as the owner does not identify a known user.public Label(String name, Namespace namespace, ConfluenceUser owner)
public String getName()
DisplayableLabel
eg. label name for label my:foo is "foo".
getName
in interface DisplayableLabel
@Deprecated public String getOwner()
getOwnerUser()
instead.public ConfluenceUser getOwnerUser()
public Namespace getNamespace()
public String getType()
getType
in interface ContentTypeAware
public boolean equals(Object o)
equals
in class com.atlassian.core.bean.EntityObject
public int hashCode()
hashCode
in class com.atlassian.core.bean.EntityObject
public int compareTo(Label otherlabel)
compareTo
in interface Comparable<Label>
public String getRealTitle()
DisplayableLabel
getRealTitle
in interface DisplayableLabel
public String getDisplayTitle()
getDisplayTitle
in interface Addressable
public boolean isRealTitleSafeForUrl()
DisplayableLabel
eg. my:foo is safe, perc% is not safe. chicken+cheese is safe in a "combined" label.
isRealTitleSafeForUrl
in interface DisplayableLabel
public String getUrlPath()
DisplayableLabel
getUrlPath
in interface Addressable
getUrlPath
in interface DisplayableLabel
public String getUrlPath(String spaceKey)
DisplayableLabel
If no space if provided, DisplayableLabel.getUrlPath()
is called.
getUrlPath
in interface DisplayableLabel
@Deprecated public boolean isNew()
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.
public boolean isPersistent()
public boolean isVisibleTo(String username)
username
- the username of the user who wishes to see the labelpublic String toStringWithOwnerPrefix()
public String toStringWithNamespace()
public boolean isTeamLabel()
Copyright © 2003–2020 Atlassian. All rights reserved.