public final class

AvatarImpl

extends Object
implements Avatar
java.lang.Object
   ↳ com.atlassian.jira.avatar.AvatarImpl

Class Overview

Immutable implementation.

Summary

[Expand]
Inherited Fields
From interface com.atlassian.jira.avatar.Avatar
Public Methods
static AvatarImpl createCustomAvatar(String fileName, String contentType, Project owner)
static AvatarImpl createCustomAvatar(String fileName, ApplicationUser owner)
static AvatarImpl createCustomAvatar(String fileName, String contentType, String ownerId, Avatar.Type type)
static AvatarImpl createSystemAvatar(String fileName, String contentType, Avatar.Type avatarType)
Factory method for creating a system Avatar to be created by AvatarManager.
boolean equals(Object o)
Avatar.Type getAvatarType()
The type of Avatar.
@Nonnull String getContentType()
The MIME type of the avatar image file.
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.
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.
int hashCode()
static boolean isOldSystemAvatar(Avatar.Type type, String filename)
boolean isSystemAvatar()
Indicates whether the Avatar is a system-provided one or if users have defined it.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.avatar.Avatar

Public Methods

public static AvatarImpl createCustomAvatar (String fileName, String contentType, Project owner)

public static AvatarImpl createCustomAvatar (String fileName, ApplicationUser owner)

public static AvatarImpl createCustomAvatar (String fileName, String contentType, String ownerId, Avatar.Type type)

public static AvatarImpl createSystemAvatar (String fileName, String contentType, Avatar.Type avatarType)

Factory method for creating a system Avatar to be created by AvatarManager.

public boolean equals (Object o)

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.

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.

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 int hashCode ()

public static boolean isOldSystemAvatar (Avatar.Type type, String filename)

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.