Package com.atlassian.jira.avatar
Class AvatarImpl
java.lang.Object
com.atlassian.jira.avatar.AvatarImpl
- All Implemented Interfaces:
Avatar
Immutable implementation.
- Since:
- v4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.avatar.Avatar
Avatar.Size, Avatar.Type -
Field Summary
Fields inherited from interface com.atlassian.jira.avatar.Avatar
demotedSystemProjectAvatars, demotedSystemUserAvatars -
Method Summary
Modifier and TypeMethodDescriptionstatic AvatarImplcreateCustomAvatar(String fileName, String contentType, String ownerId, IconType iconType) static AvatarImplcreateSystemAvatar(String fileName, String contentType, IconType iconType) Factory method for creating a system Avatar to be created byAvatarManager.booleanReturns the avatar type.The MIME type of the avatar image file.The base filename to the avatar image file.Get the icon type.getId()The database identifier for the Avatar, may be null if it hasn't yet been stored or if database identifiers are not supported.getOwner()Returns the identity of the domain object that this avatar is an avatar for.inthashCode()booleanIndicates whether the Avatar is a system-provided one or if users have defined it.
-
Method Details
-
createCustomAvatar
public static AvatarImpl createCustomAvatar(String fileName, String contentType, String ownerId, IconType iconType) -
createSystemAvatar
Factory method for creating a system Avatar to be created byAvatarManager. -
getAvatarType
Description copied from interface:AvatarReturns the avatar type.Since v7.1 plugins can add avatars to arbitrary entities. The enum will just return
Avatar.Type.OTHERif the Avatar is for a custom entity.- Specified by:
getAvatarTypein interfaceAvatar- Returns:
- a non null Avatar.Type.
-
getIconType
Description copied from interface:AvatarGet the icon type.- Specified by:
getIconTypein interfaceAvatar- Returns:
- The type of the icon.
-
getFileName
Description copied from interface:AvatarThe base filename to the avatar image file. The actual file name will be modified with the id etc.- Specified by:
getFileNamein interfaceAvatar- Returns:
- the non null file name.
-
getContentType
Description copied from interface:AvatarThe MIME type of the avatar image file.- Specified by:
getContentTypein interfaceAvatar- Returns:
- the non null file name.
-
getId
Description copied from interface:AvatarThe database identifier for the Avatar, may be null if it hasn't yet been stored or if database identifiers are not supported. This will always return null for user avatars in some deployment configurations. Avatars for other purposes (e.g. Projects) may follow this in future versions and this method will be deprecated entirely. The id should not be used to construct URLs to the currently-configured avatar for anything. This method should only be used when it is necessary to refer to an avatar that is not currently the configured avatar for the domain object. The only use cases where this is needed are those to do with modifying or viewing detailed avatar configuration. -
getOwner
Description copied from interface:AvatarReturns the identity of the domain object that this avatar is an avatar for.For example, if it is a user avatar, it would be the user key (since that is the primary key), for a Project it is the project ID as a String. The meaning of this should be determined by the
IconType.For a non-system avatar (see
Avatar.isSystemAvatar()}, the owner is never null. For a system avatar, the owner is always null. -
isSystemAvatar
public boolean isSystemAvatar()Description copied from interface:AvatarIndicates whether the Avatar is a system-provided one or if users have defined it.- Specified by:
isSystemAvatarin interfaceAvatar- Returns:
- true only if the Avatar is a system-provided one.
-
equals
-
hashCode
public int hashCode()
-