Package com.atlassian.bamboo.avatar
Enum Class AvatarType
- All Implemented Interfaces:
Serializable
,Comparable<AvatarType>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NotNull String
Builds the resource path used to stream the requested default avatar.static AvatarType
fromId
(int id) @NotNull String
@NotNull String
int
getId()
@NotNull AvatarSupplier
loadDefault
(@NotNull String id, int size) Retrieves a default avatar, potentially randomized based on the requested ID.@NotNull AvatarSupplier
loadFixedDefault
(int size) Retrieves a fixed default avatar, agnostic of any form of identifier.static AvatarType
Returns the enum constant of this class with the specified name.static AvatarType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USER
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromId
-
getContentType
- Returns:
- the content type for avatars of this type
-
getDirectoryName
- Returns:
- the directory on disk where avatars of this type are stored
-
getId
public int getId()- Returns:
- a fixed ID for this avatar type, used for serialization
-
loadDefault
Retrieves a default avatar, potentially randomized based on the requested ID.- Parameters:
id
- the entity ID for which a default avatar is being requestedsize
- the size of the avatar being requested- Returns:
- a supplier for providing access to the selected default avatar
-
loadFixedDefault
Retrieves a fixed default avatar, agnostic of any form of identifier. This is primarily intended to simplify retrieving a default avatar in anonymous or unauthorized contexts where a fixed avatar should be returned to prevent leaking information about whether or not a given object exists.- Parameters:
size
- the size of the avatar being requested- Returns:
- a supplier providing access to the default avatar
-
buildPath
Builds the resource path used to stream the requested default avatar.- Parameters:
id
- the entity ID, potentially used to randomize the default avatarsize
- the size of the avatar being requested- Returns:
- the resource path to open to stream the requested default avatar
- Since:
- 4.4
-