Class AvatarOptions.AvatarOptionsBuilder<C extends AvatarOptions,B extends AvatarOptions.AvatarOptionsBuilder<C,B>>
java.lang.Object
de.kaiserpfalzedv.commons.api.libravatar.AvatarOptions.AvatarOptionsBuilder<C,B>
- Enclosing class:
AvatarOptions
public abstract static class AvatarOptions.AvatarOptionsBuilder<C extends AvatarOptions,B extends AvatarOptions.AvatarOptionsBuilder<C,B>>
extends Object
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies a custom base URI for HTTP use.abstract C
build()
defaultImage
(LibravatarDefaultImage defaultImage) URI for a default image, if no image is found for the user.Size of the image requested.secureBaseUri
(String secureBaseUri) Specifies a custom base URI for HTTPS use.toString()
useHttps
(boolean useHttps) Produce https:// URIs where possible.useSHA256
(boolean useSHA256) Use the SHA256 hash algorithm, rather than MD5.
-
Constructor Details
-
AvatarOptionsBuilder
public AvatarOptionsBuilder()
-
-
Method Details
-
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
.
-
build
-
toString
-