Class AvatarOptions
java.lang.Object
de.kaiserpfalzedv.commons.api.libravatar.AvatarOptions
- All Implemented Interfaces:
Serializable
@ConfigurationProperties("libravatar")
public class AvatarOptions
extends Object
implements Serializable
AvatarOptions -- The configuration for libravatar.
- Since:
- 3.0.0 2023-01-19
- Author:
- rlichti <rlichti@kaiserpfalz-edv.de>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AvatarOptions.AvatarOptionsBuilder<C extends AvatarOptions,
B extends AvatarOptions.AvatarOptionsBuilder<C, B>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseUri()
Specifies a custom base URI for HTTP use.Specifies a custom base URI for HTTP use.static AvatarOptions.AvatarOptionsBuilder
<?, ?> builder()
URI for a default image, if no image is found for the user.defaultImage
(LibravatarDefaultImage defaultImage) URI for a default image, if no image is found for the user.boolean
int
hashCode()
Size of the image requested.Size of the image requested.Specifies a custom base URI for HTTPS use.secureBaseUri
(String secureBaseUri) Specifies a custom base URI for HTTPS use.toString()
boolean
useHttps()
Produce https:// URIs where possible.useHttps
(boolean useHttps) Produce https:// URIs where possible.boolean
Use the SHA256 hash algorithm, rather than MD5.useSHA256
(boolean useSHA256) Use the SHA256 hash algorithm, rather than MD5.
-
Constructor Details
-
AvatarOptions
public AvatarOptions()
-
-
Method Details
-
builder
-
toBuilder
-
baseUri
Specifies a custom base URI for HTTP use. The default is to use the official libravatar HTTP server. If you *really* wanted to use a non-free server, you could set this to "http://gravatar.com/avatar/", but why would you do such a thing? -
secureBaseUri
Specifies a custom base URI for HTTPS use. The default is to use the official libravatar HTTPS server. -
useHttps
public boolean useHttps()Produce https:// URIs where possible. This avoids mixed-content warnings in browsers when using libravatar-sharp from within a page served via HTTPS. -
useSHA256
public boolean useSHA256()Use the SHA256 hash algorithm, rather than MD5. SHA256 is significantly stronger, but is not supported by Gravatar, so libravatar's fallback to Gravatar for missing images will not work. Note that using Avatar.FromOpenID implicitly uses SHA256. -
defaultImage
URI for a default image, if no image is found for the user. This also accepts any of the "special" values in AvatarDefaultImages -
imageSize
Size of the image requested. Valid values are between 1 and 512 pixels. The default size is 80 pixels. -
baseUri
Specifies a custom base URI for HTTP use. The default is to use the official libravatar HTTP server. If you *really* wanted to use a non-free server, you could set this to "http://gravatar.com/avatar/", but why would you do such a thing?- Returns:
this
.
-
secureBaseUri
Specifies a custom base URI for HTTPS use. The default is to use the official libravatar HTTPS server.- Returns:
this
.
-
useHttps
Produce https:// URIs where possible. This avoids mixed-content warnings in browsers when using libravatar-sharp from within a page served via HTTPS.- Returns:
this
.
-
useSHA256
Use the SHA256 hash algorithm, rather than MD5. SHA256 is significantly stronger, but is not supported by Gravatar, so libravatar's fallback to Gravatar for missing images will not work. Note that using Avatar.FromOpenID implicitly uses SHA256.- Returns:
this
.
-
defaultImage
URI for a default image, if no image is found for the user. This also accepts any of the "special" values in AvatarDefaultImages- Returns:
this
.
-
imageSize
Size of the image requested. Valid values are between 1 and 512 pixels. The default size is 80 pixels.- Returns:
this
.
-
equals
-
hashCode
public int hashCode() -
toString
-