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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The standard sizes for avatars.
    static enum 
    Deprecated.
    Use IconType in place of this.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<String>
    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.
    static final List<String>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Use getIconType() instead.
    The MIME type of the avatar image file.
    The base filename to the avatar image file.
    Get the icon type.
    The database identifier for the Avatar, may be null if it hasn't yet been stored or if database identifiers are not supported.
    Returns the identity of the domain object that this avatar is an avatar for.
    boolean
    Indicates whether the Avatar is a system-provided one or if users have defined it.
  • Field Details

    • demotedSystemProjectAvatars

      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.
    • demotedSystemUserAvatars

      static final List<String> demotedSystemUserAvatars
  • Method Details

    • getAvatarType

      @Nonnull Avatar.Type getAvatarType()
      Deprecated.
      Use getIconType() instead. Since v7.1
      Returns the avatar type.

      Since v7.1 plugins can add avatars to arbitrary entities. The enum will just return Avatar.Type.OTHER if the Avatar is for a custom entity.

      Returns:
      a non null Avatar.Type.
    • getIconType

      @Nonnull IconType getIconType()
      Get the icon type.
      Returns:
      The type of the icon.
      Since:
      v7.1
    • getFileName

      @Nonnull 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.
    • getContentType

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