Package com.atlassian.bitbucket.avatar
Class AvatarRequest
java.lang.Object
com.atlassian.bitbucket.avatar.AvatarRequest
-
Constructor Summary
ConstructorsConstructorDescriptionAvatarRequest(boolean secure, @javax.validation.constraints.Min(1L) int size) useConfiguredis defaulted tofalseAvatarRequest(boolean secure, @javax.validation.constraints.Min(1L) int size, boolean useConfigured) Constructs a newAvatarRequestfor the providedschemeandsize. -
Method Summary
-
Constructor Details
-
AvatarRequest
public AvatarRequest(boolean secure, @Min(1L) @javax.validation.constraints.Min(1L) int size) useConfiguredis defaulted tofalse- Parameters:
secure-trueif avatar URLs should use HTTPS; otherwise,falsefor 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 newAvatarRequestfor the providedschemeandsize.The
secureflag allows the caller to control whether avatar URLs use HTTP or HTTPS. Thesizecontrols the dimensions of the avatar returned.- Parameters:
secure-trueif avatar URLs should use HTTPS; otherwise,falsefor HTTPsize- the height/width of the avatar being requesteduseConfigured- whether to use the configured base URL; iffalsethe request context will be used instead- Throws:
IllegalArgumentException- if the providedsizeis less than 1.NullPointerException- if the providedschemeisnull.
-
-
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:
trueif the URL should use the configured base URL.falseotherwise
-
equals
-
hashCode
public int hashCode()
-