@PublicApi public interface

Avatar

com.atlassian.jira.avatar.Avatar
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Represents an icon for a project or some other entity in JIRA.

Summary

Nested Classes
enum Avatar.Size The standard sizes for avatars. 
enum Avatar.Type An indicator of the owner type of the avatar. 
Fields
public static final List<String> 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.
public static final List<String> demotedSystemUserAvatars
Public Methods
@Nonnull Avatar.Type getAvatarType()
The type of Avatar.
@Nonnull String getContentType()
The MIME type of the avatar image file.
@Nonnull String getFileName()
The base filename to the avatar image file.
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.
@Nonnull String getOwner()
A String representation of 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 username (since that is the primary key), for a Project it is the project ID as a String.
boolean isSystemAvatar()
Indicates whether the Avatar is a system-provided one or if users have defined it.

Fields

public static final List<String> 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.

public static final List<String> demotedSystemUserAvatars

Public Methods

@Nonnull public Avatar.Type getAvatarType ()

The type of Avatar.

Returns
  • a non null Avatar.Type.

@Nonnull public String getContentType ()

The MIME type of the avatar image file.

Returns
  • the non null file name.

@Nonnull public String 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.

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

@Nonnull public String getOwner ()

A String representation of 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 username (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 Avatar.Type.

Returns
  • the owner id must not be null.

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