Enum Class AvatarType

java.lang.Object
java.lang.Enum<AvatarType>
com.atlassian.bamboo.avatar.AvatarType
All Implemented Interfaces:
Serializable, Comparable<AvatarType>, Constable

public enum AvatarType extends Enum<AvatarType>
  • Enum Constant Details

  • Method Details

    • values

      public static AvatarType[] 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 AvatarType 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
    • fromId

      public static AvatarType fromId(int id)
    • getContentType

      @NotNull public @NotNull String getContentType()
      Returns:
      the content type for avatars of this type
    • getDirectoryName

      @NotNull public @NotNull String 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

      @NotNull public @NotNull AvatarSupplier loadDefault(@NotNull @NotNull String id, int size)
      Retrieves a default avatar, potentially randomized based on the requested ID.
      Parameters:
      id - the entity ID for which a default avatar is being requested
      size - the size of the avatar being requested
      Returns:
      a supplier for providing access to the selected default avatar
    • loadFixedDefault

      @NotNull public @NotNull AvatarSupplier loadFixedDefault(int size)
      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

      @NotNull protected abstract @NotNull String buildPath(@NotNull @NotNull String id, int size)
      Builds the resource path used to stream the requested default avatar.
      Parameters:
      id - the entity ID, potentially used to randomize the default avatar
      size - the size of the avatar being requested
      Returns:
      the resource path to open to stream the requested default avatar
      Since:
      4.4