com.atlassian.jira.sharing
Class SharedEntity.Identifier

java.lang.Object
  extended by com.atlassian.jira.sharing.SharedEntity.Identifier
All Implemented Interfaces:
Favourite, SharedEntity
Enclosing interface:
SharedEntity

public static class SharedEntity.Identifier
extends Object
implements SharedEntity

Utility class for identifying a SharedEntity. This can be used instead of a "proper" implementation.


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
SharedEntity.Identifier(Long id, SharedEntity.TypeDescriptor<? extends SharedEntity> type, String ownerUserName)
           
SharedEntity.Identifier(Long id, SharedEntity.TypeDescriptor<? extends SharedEntity> type, com.atlassian.crowd.embedded.api.User owner)
           
SharedEntity.Identifier(Long id, SharedEntity.TypeDescriptor<? extends SharedEntity> type, User owner)
           
 
Method Summary
 boolean equals(Object o)
           
 String getDescription()
          A general description of the entity.
 SharedEntity.TypeDescriptor<SharedEntity> 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.
 String getOwnerUserName()
          The user name of the owner of the entity.
 SharedEntity.SharePermissions getPermissions()
          The permissions for this entity.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedEntity.Identifier

public SharedEntity.Identifier(Long id,
                               SharedEntity.TypeDescriptor<? extends SharedEntity> type,
                               String ownerUserName)

SharedEntity.Identifier

public SharedEntity.Identifier(Long id,
                               SharedEntity.TypeDescriptor<? extends SharedEntity> type,
                               com.atlassian.crowd.embedded.api.User owner)

SharedEntity.Identifier

public SharedEntity.Identifier(Long id,
                               SharedEntity.TypeDescriptor<? extends SharedEntity> type,
                               User owner)
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.

getOwnerUserName

public String getOwnerUserName()
Description copied from interface: SharedEntity
The user name of the owner of the entity. Will always have permission to see it and see all shares.

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<SharedEntity> 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.

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.

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.

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2011 Atlassian. All Rights Reserved.