public static final enum

Avatar.Size

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.atlassian.jira.avatar.Avatar.Size

Class Overview

The standard sizes for avatars.

Summary

Enum Values
Avatar.Size  LARGE  A large avatar (48x48 pixels). 
Avatar.Size  LARGE_3X   
Avatar.Size  MEDIUM  A medium avatar (32x32 pixels). 
Avatar.Size  NORMAL  A small avatar (24x24 pixels). 
Avatar.Size  NORMAL_3X   
Avatar.Size  RETINA_XXLARGE   
Avatar.Size  RETINA_XXLARGE_3X   
Avatar.Size  RETINA_XXXLARGE   
Avatar.Size  RETINA_XXXLARGE_3X   
Avatar.Size  SMALL  An extra-small avatar (16x16 pixels). 
Avatar.Size  XLARGE   
Avatar.Size  XXLARGE   
Avatar.Size  XXXLARGE   
Fields
public static final Predicate<Avatar.Size> LOW_RES
Public Methods
static 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 defaultSize()
static Avatar.Size fromString(String text)
Returns an avatar image size matching the text provided.
String getParam()
int getPixels()
static Avatar.Size getSizeFromParam(String param)
Returns the Avatar.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)
String toString()
static Avatar.Size valueOf(String name)
final static Size[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

public static final Avatar.Size LARGE

A large avatar (48x48 pixels).

public static final Avatar.Size LARGE_3X

public static final Avatar.Size MEDIUM

A medium avatar (32x32 pixels). Use in comments and other activity streams.

public static final Avatar.Size NORMAL

A small avatar (24x24 pixels). Use when outputting user's names.

public static final Avatar.Size NORMAL_3X

public static final Avatar.Size RETINA_XXLARGE

public static final Avatar.Size RETINA_XXLARGE_3X

public static final Avatar.Size RETINA_XXXLARGE

public static final Avatar.Size RETINA_XXXLARGE_3X

public static final Avatar.Size SMALL

An extra-small avatar (16x16 pixels).

public static final Avatar.Size XLARGE

public static final Avatar.Size XXLARGE

public static final Avatar.Size XXXLARGE

Fields

public static final Predicate<Avatar.Size> LOW_RES

Public Methods

public static 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.

public static Avatar.Size biggerThan (int pixelValue)

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.

public static Avatar.Size defaultSize ()

Returns
  • the default size for avatars.

public static Avatar.Size fromString (String text)

Returns an avatar image size matching the text provided. If none can be found, returns defaultSize().

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

public String getParam ()

public int getPixels ()

public static Avatar.Size getSizeFromParam (String param)

Returns the Avatar.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
Throws
NoSuchElementException if there is no known size by that name.

public static Avatar.Size largest ()

In order to cater for future addition of larger sizes this method finds the largest image size.

Returns
  • The largest Size

public static Avatar.Size smallerThan (int pixelValue)

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.

public String toString ()

public static Avatar.Size valueOf (String name)

public static final Size[] values ()