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 Details

    • AvatarOptionsBuilder

      public AvatarOptionsBuilder()
  • Method Details

    • baseUri

      public B baseUri(String 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

      public B secureBaseUri(String secureBaseUri)
      Specifies a custom base URI for HTTPS use. The default is to use the official libravatar HTTPS server.
      Returns:
      this.
    • useHttps

      public B useHttps(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.
      Returns:
      this.
    • useSHA256

      public B useSHA256(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.
      Returns:
      this.
    • defaultImage

      public B defaultImage(LibravatarDefaultImage 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

      public B imageSize(Integer imageSize)
      Size of the image requested. Valid values are between 1 and 512 pixels. The default size is 80 pixels.
      Returns:
      this.
    • build

      public abstract C build()
    • toString

      public String toString()
      Overrides:
      toString in class Object