Package com.atlassian.jira.mock
Class MockAvatar
java.lang.Object
com.atlassian.jira.mock.MockAvatar
- All Implemented Interfaces:
Avatar
Non production bean implementation of
Avatar.- 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 -
Constructor Summary
ConstructorsConstructorDescriptionMockAvatar(long id, String fileName, String contentType, Avatar.Type type, String owner, boolean system) Deprecated.MockAvatar(long id, String fileName, String contentType, IconType iconType, String owner, boolean system) -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.booleanIndicates whether the Avatar is a system-provided one or if users have defined it.
-
Constructor Details
-
MockAvatar
-
MockAvatar
@Deprecated public MockAvatar(long id, String fileName, String contentType, Avatar.Type type, String owner, boolean system) Deprecated.
-
-
Method Details
-
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.
-
getContentType
Description copied from interface:AvatarThe MIME type of the avatar image file.- Specified by:
getContentTypein interfaceAvatar- Returns:
- the non null file name.
-
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.
-
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.
-