Enum Class Avatar.Size

java.lang.Object
java.lang.Enum<Avatar.Size>
com.atlassian.jira.avatar.Avatar.Size
All Implemented Interfaces:
Serializable, Comparable<Avatar.Size>, Constable
Enclosing interface:
Avatar

public static enum Avatar.Size extends Enum<Avatar.Size>
The standard sizes for avatars.
  • Enum Constant Details

    • NORMAL

      public static final Avatar.Size NORMAL
      A small avatar (24x24 pixels). Use when outputting user's names.
    • SMALL

      public static final Avatar.Size SMALL
      An extra-small avatar (16x16 pixels).
    • MEDIUM

      public static final Avatar.Size MEDIUM
      A medium avatar (32x32 pixels). Use in comments and other activity streams.
    • LARGE

      public static final Avatar.Size LARGE
      A large avatar (48x48 pixels).
    • XLARGE

      public static final Avatar.Size XLARGE
    • NORMAL_3X

      public static final Avatar.Size NORMAL_3X
    • XXLARGE

      public static final Avatar.Size XXLARGE
    • XXXLARGE

      public static final Avatar.Size XXXLARGE
    • LARGE_3X

      public static final Avatar.Size LARGE_3X
    • RETINA_XXLARGE

      public static final Avatar.Size RETINA_XXLARGE
    • RETINA_XXXLARGE

      public static final Avatar.Size RETINA_XXXLARGE
    • RETINA_XXLARGE_3X

      public static final Avatar.Size RETINA_XXLARGE_3X
    • RETINA_XXXLARGE_3X

      public static final Avatar.Size RETINA_XXXLARGE_3X
  • Field Details

    • LOW_RES

      public static final com.google.common.base.Predicate<Avatar.Size> LOW_RES
  • Method Details

    • values

      public static Avatar.Size[] 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

      public static Avatar.Size valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • largest

      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
    • defaultSize

      public static Avatar.Size defaultSize()
      Returns:
      the default size for avatars.
    • biggerThan

      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.
    • smallerThan

      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.
    • getPixels

      public int getPixels()
    • getParam

      public String getParam()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Avatar.Size>
    • getSizeFromParam

      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:
      the corresponding Avatar.Size
      Throws:
      NoSuchElementException - if there is no known size by that name.
    • fromString

      @Nonnull 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
    • approx

      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.
      Parameters:
      size -
      Returns: