Package com.atlassian.jira.avatar
Enum Class Avatar.Size
- All Implemented Interfaces:
Serializable
,Comparable<Avatar.Size>
,Constable
- Enclosing interface:
- Avatar
The standard sizes for avatars.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA large avatar (48x48 pixels).A medium avatar (32x32 pixels).A small avatar (24x24 pixels).An extra-small avatar (16x16 pixels). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Avatar.Size
approx
(int size) Returns the Size which is exactly the same size as the given pixel edge value, rounding upward if no exact match is available, except if the given value is greater than the maximum available size in which case the maximum size will be returned.static Avatar.Size
biggerThan
(int pixelValue) static Avatar.Size
static Avatar.Size
fromString
(String text) Returns an avatar image size matching the text provided.getParam()
int
static Avatar.Size
getSizeFromParam
(String param) Returns theAvatar.Size
for the given AUI standard size name.static Avatar.Size
largest()
In order to cater for future addition of larger sizes this method finds the largest image size.static Avatar.Size
smallerThan
(int pixelValue) toString()
static Avatar.Size
Returns the enum constant of this class with the specified name.static Avatar.Size[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORMAL
A small avatar (24x24 pixels). Use when outputting user's names. -
SMALL
An extra-small avatar (16x16 pixels). -
MEDIUM
A medium avatar (32x32 pixels). Use in comments and other activity streams. -
LARGE
A large avatar (48x48 pixels). -
XLARGE
-
NORMAL_3X
-
XXLARGE
-
XXXLARGE
-
LARGE_3X
-
RETINA_XXLARGE
-
RETINA_XXXLARGE
-
RETINA_XXLARGE_3X
-
RETINA_XXXLARGE_3X
-
-
Field Details
-
LOW_RES
-
-
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
-
largest
In order to cater for future addition of larger sizes this method finds the largest image size.- Returns:
- The largest Size
-
defaultSize
- Returns:
- the default size for avatars.
-
biggerThan
- Parameters:
pixelValue
- minimum number of pixels tall+wide the avatar size should be- Returns:
- an avatar
Avatar.Size
that's equal to or larger than the pixelValue, or null if there's no size that could cater the value.
-
smallerThan
- Parameters:
pixelValue
- minimum number of pixels tall+wide the avatar size should be- Returns:
- an avatar
Avatar.Size
that's equal to or larger than the pixelValue, or null if there's no size that could cater the value.
-
getPixels
public int getPixels() -
getParam
-
toString
- Overrides:
toString
in classEnum<Avatar.Size>
-
getSizeFromParam
Returns theAvatar.Size
for the given AUI standard size name.Each AUI size name can be specified with a 2x or 3x multiplier. So the following sizes are available:
- xsmall, xsmall@2x, xsmall@3x
- small, small@2x, small@3x
- medium, medium@2x, medium@3x
- large, large@2x, large@3x
- xlarge, xlarge@2x, xlarge@3x
- xxlarge, xxlarge@2x, xxlarge@3x
- xxxlarge, xxxlarge@2x, xxxlarge@3x
- Parameters:
param
- the standard name of the size (e.g. small, medium, xlarge), may be multiplied- Returns:
- the corresponding
Avatar.Size
- Throws:
NoSuchElementException
- if there is no known size by that name.
-
fromString
Returns an avatar image size matching the text provided. If none can be found, returnsdefaultSize()
.- Parameters:
text
- the images size. Will match "s", "small", "SMALL". Can also be an integer value (16, 24, etc.)- Returns:
- the image size enum matching the string provided
-
approx
Returns the Size which is exactly the same size as the given pixel edge value, rounding upward if no exact match is available, except if the given value is greater than the maximum available size in which case the maximum size will be returned.- Parameters:
size
-- Returns:
-