com.atlassian.confluence.labels
Class Labelling

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.labels.Labelling
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Labelling
extends com.atlassian.core.bean.EntityObject
implements java.io.Serializable

An ostensibly immutable object that represents the link between labels and the content they label. This represents a union type, internally only one of content, attachment or pagetemplate should be not null for any instance of a Labelling, this is what will be returned from getContent. The labelableType and labelableId fields in this class are summary fields, and are present to make the queries around popular and related labels easier.

See Also:
Serialized Form

Constructor Summary
Labelling()
          Available so that newInstance can be used by hibernate to create this object.
Labelling(Label label, EditableLabelable labelable, ConfluenceUser user)
           
Labelling(Label label, EditableLabelable labelable, java.lang.String user)
          Deprecated. since 5.2.
 
Method Summary
 Labelling copy()
           
 Labelling copy(EditableLabelable labelable)
          Copies the current Labelling, but providing it with a new EditableLabelable.
 boolean equals(java.lang.Object o)
           
protected  Attachment getAttachment()
           
protected  ContentEntityObject getContent()
           
 Label getLabel()
           
protected  java.lang.Long getLabelableId()
           
protected  java.lang.String getLabelableType()
           
 EditableLabelable getLableable()
          Getter for the content entity object associated with this labelling.
 ConfluenceUser getOwningUser()
           
protected  PageTemplate getPageTemplate()
           
 java.lang.String getUser()
          Deprecated. since 5.2. User getOwningUser() instead.
 int hashCode()
           
protected  void setAttachment(Attachment attachment)
           
protected  void setContent(ContentEntityObject ceo)
           
protected  void setLabelable(EditableLabelable labelable)
          Setter for the content entity object associated with this labelling.
protected  void setLabelableId(java.lang.Long id)
           
protected  void setLabelableType(java.lang.String type)
           
protected  void setPageTemplate(PageTemplate pageTemplate)
           
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Labelling

@Deprecated
public Labelling(Label label,
                            EditableLabelable labelable,
                            java.lang.String user)
Deprecated. since 5.2.

Parameters:
label -
labelable -
user - the username of the user who owns this Labellings
Throws:
java.lang.IllegalArgumentException - if the user does not identify a known user

Labelling

public Labelling(Label label,
                 EditableLabelable labelable,
                 ConfluenceUser user)

Labelling

public Labelling()
Available so that newInstance can be used by hibernate to create this object.

Method Detail

getLableable

public EditableLabelable getLableable()
Getter for the content entity object associated with this labelling.

Returns:
content

setLabelable

protected void setLabelable(EditableLabelable labelable)
Setter for the content entity object associated with this labelling.

Parameters:
content -

getLabel

public Label getLabel()

getUser

@Deprecated
public java.lang.String getUser()
Deprecated. since 5.2. User getOwningUser() instead.


getOwningUser

public ConfluenceUser getOwningUser()
Since:
5.2

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class com.atlassian.core.bean.EntityObject

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAttachment

protected Attachment getAttachment()

getPageTemplate

protected PageTemplate getPageTemplate()

getContent

protected ContentEntityObject getContent()

setAttachment

protected void setAttachment(Attachment attachment)

setPageTemplate

protected void setPageTemplate(PageTemplate pageTemplate)

setContent

protected void setContent(ContentEntityObject ceo)

setLabelableId

protected void setLabelableId(java.lang.Long id)

getLabelableId

protected java.lang.Long getLabelableId()

setLabelableType

protected void setLabelableType(java.lang.String type)

getLabelableType

protected java.lang.String getLabelableType()

copy

public Labelling copy()

copy

public Labelling copy(EditableLabelable labelable)
Copies the current Labelling, but providing it with a new EditableLabelable.



Copyright © 2003-2014 Atlassian. All Rights Reserved.