Package com.atlassian.jira.avatar
Interface Avatar
- All Known Implementing Classes:
AvatarImpl,MockAvatar
@PublicApi
public interface Avatar
Represents an icon for a project or some other entity in JIRA.
- Since:
- v4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe standard sizes for avatars.static enumDeprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionThese are the filenames of avatars that used to be available as system avatars, but were to be removed from the list of avatar options available to new projects. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.UsegetIconType()instead.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.booleanIndicates whether the Avatar is a system-provided one or if users have defined it.
-
Field Details
-
demotedSystemProjectAvatars
These are the filenames of avatars that used to be available as system avatars, but were to be removed from the list of avatar options available to new projects. -
demotedSystemUserAvatars
-
-
Method Details
-
getAvatarType
Deprecated.UsegetIconType()instead. Since v7.1Returns 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.- Returns:
- a non null Avatar.Type.
-
getIconType
Get the icon type.- Returns:
- The type of the icon.
- Since:
- v7.1
-
getFileName
The base filename to the avatar image file. The actual file name will be modified with the id etc.- Returns:
- the non null file name.
-
getContentType
The MIME type of the avatar image file.- Returns:
- the non null file name.
-
getId
Long getId()The 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.- Returns:
- the database id or null.
-
getOwner
String getOwner()Returns 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
isSystemAvatar()}, the owner is never null. For a system avatar, the owner is always null.- Returns:
- the ID of the domain object that this is the avatar for.
-
isSystemAvatar
boolean isSystemAvatar()Indicates whether the Avatar is a system-provided one or if users have defined it.- Returns:
- true only if the Avatar is a system-provided one.
-
IconTypein place of this.