com.atlassian.jira.sharing
Class IndexableSharedEntity<S extends SharedEntity>

java.lang.Object
  extended by com.atlassian.jira.sharing.IndexableSharedEntity<S>
All Implemented Interfaces:
Favourite, SharedEntity

public class IndexableSharedEntity<S extends SharedEntity>
extends Object
implements SharedEntity

Represents a SharedEntity in a lightweight way that can be used for indexing. Like SearchRequests, you can set the share permissions after construction because they might not always be available at that time.

Since:
v4.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.sharing.SharedEntity
SharedEntity.Identifier, SharedEntity.SharePermissions, SharedEntity.TypeDescriptor<S extends SharedEntity>
 
Constructor Summary
IndexableSharedEntity(Long id, String name, String description, SharedEntity.TypeDescriptor<S> entityType, ApplicationUser owner, Long favouriteCount)
           
IndexableSharedEntity(Long id, String name, String description, SharedEntity.TypeDescriptor<S> entityType, ApplicationUser owner, Long favouriteCount, SharedEntity.SharePermissions permissions)
           
 
Method Summary
 boolean equals(Object o)
           
 String getDescription()
          A general description of the entity.
 SharedEntity.TypeDescriptor<S> getEntityType()
          The type of entity it is.
 Long getFavouriteCount()
          The number of users who have marked this entity as one of their favourites.
 Long getId()
          The id of the entity.
 String getName()
          The name of the entity.
 ApplicationUser getOwner()
           
 String getOwnerUserName()
           
 SharedEntity.SharePermissions getPermissions()
          The permissions for this entity.
 int hashCode()
           
 void setPermissions(SharedEntity.SharePermissions permissions)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexableSharedEntity

public IndexableSharedEntity(Long id,
                             String name,
                             String description,
                             SharedEntity.TypeDescriptor<S> entityType,
                             ApplicationUser owner,
                             Long favouriteCount)

IndexableSharedEntity

public IndexableSharedEntity(Long id,
                             String name,
                             String description,
                             SharedEntity.TypeDescriptor<S> entityType,
                             ApplicationUser owner,
                             Long favouriteCount,
                             SharedEntity.SharePermissions permissions)
Method Detail

getId

public Long getId()
Description copied from interface: SharedEntity
The id of the entity.

Specified by:
getId in interface SharedEntity
Returns:
the id. May be null if not yet persisted. Some components may not accept a non-persisted entity.

getName

public String getName()
Description copied from interface: SharedEntity
The name of the entity.

Specified by:
getName in interface SharedEntity
Returns:
the name. Must not be null or empty.

getDescription

public String getDescription()
Description copied from interface: SharedEntity
A general description of the entity.

Specified by:
getDescription in interface SharedEntity
Returns:
the description. May be null or empty.

getOwner

public ApplicationUser getOwner()
Specified by:
getOwner in interface SharedEntity

getOwnerUserName

public String getOwnerUserName()
Specified by:
getOwnerUserName in interface SharedEntity
Returns:
The user name of the user who owns this entity. May be null for anonymous user.

getEntityType

public SharedEntity.TypeDescriptor<S> getEntityType()
Description copied from interface: SharedEntity
The type of entity it is. Examples include SearchRequest ("SearchRequest") and PortalPage ("PortalPage")

Specified by:
getEntityType in interface SharedEntity
Returns:
the type of entity.

getPermissions

public SharedEntity.SharePermissions getPermissions()
Description copied from interface: SharedEntity
The permissions for this entity.

Specified by:
getPermissions in interface SharedEntity
Returns:
the permissions object. Must not be null.

setPermissions

public void setPermissions(SharedEntity.SharePermissions permissions)

getFavouriteCount

public Long getFavouriteCount()
Description copied from interface: Favourite
The number of users who have marked this entity as one of their favourites.

Specified by:
getFavouriteCount in interface Favourite
Returns:
long the user count

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2002-2015 Atlassian. All Rights Reserved.