public class

AvatarRequest

extends Object
java.lang.Object
   ↳ com.atlassian.bitbucket.avatar.AvatarRequest

Summary

Public Constructors
AvatarRequest(boolean secure, int size)
useConfigured is defaulted to false
AvatarRequest(boolean secure, int size, boolean useConfigured)
Constructs a new AvatarRequest for the provided scheme and size.
Public Methods
boolean equals(Object o)
int getSize()
Retrieves the size desired for the avatar.
int hashCode()
boolean isSecure()
Retrieves a flag indicating whether avatar URLs should use HTTPS.
boolean isUseConfigured()
Retrieve the URL using the configured base URL.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AvatarRequest (boolean secure, int size)

useConfigured is defaulted to false

public AvatarRequest (boolean secure, int size, boolean useConfigured)

Constructs a new AvatarRequest for the provided scheme and size.

The secure flag allows the caller to control whether avatar URLs use HTTP or HTTPS. The size controls the dimensions of the avatar returned.

Parameters
secure true if avatar URLs should use HTTPS; otherwise, false for HTTP
size the height/width of the avatar being requested
useConfigured whether to use the configured base URL; if false the request context will be used instead
Throws
IllegalArgumentException if the provided size is less than 1.
NullPointerException if the provided scheme is null.

Public Methods

public boolean equals (Object o)

public int getSize ()

Retrieves the size desired for the avatar. Avatars are assumed to be square, so the size is used for both the height and the width.

Returns
  • the size

public int hashCode ()

public boolean isSecure ()

Retrieves a flag indicating whether avatar URLs should use HTTPS. If the flag is true, the returned URLs will use HTTPS; otherwise, they will use HTTP.

Returns
  • the scheme

public boolean isUseConfigured ()

Retrieve the URL using the configured base URL. This flag is only applicable to avatar sources which serve from the current application. Avatars hosted remotely ignore this flag

Returns
  • true if the URL should use the configured base URL. false otherwise