Package com.atlassian.bitbucket.avatar
Class AvatarRequest
java.lang.Object
com.atlassian.bitbucket.avatar.AvatarRequest
-
Constructor Summary
ConstructorDescriptionAvatarRequest
(boolean secure, @javax.validation.constraints.Min(1L) int size) useConfigured
is defaulted tofalse
AvatarRequest
(boolean secure, @javax.validation.constraints.Min(1L) int size, boolean useConfigured) Constructs a newAvatarRequest
for the providedscheme
andsize
. -
Method Summary
-
Constructor Details
-
AvatarRequest
public AvatarRequest(boolean secure, @Min(1L) @javax.validation.constraints.Min(1L) int size) useConfigured
is defaulted tofalse
- Parameters:
secure
-true
if avatar URLs should use HTTPS; otherwise,false
for HTTPsize
- the height/width of the avatar being requested- See Also:
-
AvatarRequest
public AvatarRequest(boolean secure, @Min(1L) @javax.validation.constraints.Min(1L) int size, boolean useConfigured) Constructs a newAvatarRequest
for the providedscheme
andsize
.The
secure
flag allows the caller to control whether avatar URLs use HTTP or HTTPS. Thesize
controls the dimensions of the avatar returned.- Parameters:
secure
-true
if avatar URLs should use HTTPS; otherwise,false
for HTTPsize
- the height/width of the avatar being requesteduseConfigured
- whether to use the configured base URL; iffalse
the request context will be used instead- Throws:
IllegalArgumentException
- if the providedsize
is less than 1.NullPointerException
- if the providedscheme
isnull
.
-
-
Method Details
-
getSize
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
-
isSecure
public boolean isSecure()Retrieves a flag indicating whether avatar URLs should use HTTPS. If the flag istrue
, the returned URLs will use HTTPS; otherwise, they will use HTTP.- Returns:
- the scheme
-
isUseConfigured
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
-
equals
-
hashCode
public int hashCode()
-