Package ch.andre601.fluxpoint4j.welcome
Class WelcomeImage.Builder
- java.lang.Object
-
- ch.andre601.fluxpoint4j.welcome.WelcomeImage.Builder
-
- Enclosing class:
- WelcomeImage
public static class WelcomeImage.Builder extends java.lang.Object
Builder class to create a newWelcomeImage instance
to use in theFluxpoint4J class
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WelcomeImage
build()
WelcomeImage.Builder
withAvatar(@NotNull java.lang.String avatar)
Sets the avatar to display on the image.WelcomeImage.Builder
withBackgroundColor(@NotNull ColorObject backgroundColor)
Sets the background color to use.WelcomeImage.Builder
withBanner(@NotNull java.lang.String banner)
Sets the banner to display.WelcomeImage.Builder
withIcon(@NotNull java.lang.String icon)
Sets the icon to display on the right side of the image.WelcomeImage.Builder
withMembersColor(@NotNull ColorObject membersColor)
Sets the color for themembers text
.WelcomeImage.Builder
withMembersText(@NotNull java.lang.String membersText)
Set the text that should be displayed under the username.WelcomeImage.Builder
withUsername(@NotNull java.lang.String username)
Sets the username to display on the image.WelcomeImage.Builder
withUsernameColor(@NotNull ColorObject usernameColor)
Sets the color for the username.WelcomeImage.Builder
withWelcomeColor(@NotNull ColorObject welcomeColor)
Sets the color for the "Welcome" text on the image.
-
-
-
Method Detail
-
withUsername
public WelcomeImage.Builder withUsername(@NotNull @NotNull java.lang.String username)
Sets the username to display on the image.
This option is required to be used!- Parameters:
username
- The username to display.- Returns:
- This Builder instance. Useful for chaining.
-
withAvatar
public WelcomeImage.Builder withAvatar(@NotNull @NotNull java.lang.String avatar)
Sets the avatar to display on the image. The String needs to be a valid URL.
This option is required to be used!- Parameters:
avatar
- The URL of the avatar to display.- Returns:
- This Builder instance. Useful for chaining.
-
withBackgroundColor
public WelcomeImage.Builder withBackgroundColor(@NotNull @NotNull ColorObject backgroundColor)
Sets the background color to use.
This option is required to be used!Please see the
ColorObject class
for more info on what formats are supported.- Parameters:
backgroundColor
- TheColorObject
to use for the background.- Returns:
- This Builder instance. Useful for chaining.
-
withMembersText
public WelcomeImage.Builder withMembersText(@NotNull @NotNull java.lang.String membersText)
Set the text that should be displayed under the username.
You can provide an empty String to hide the text.- Parameters:
membersText
- The text to display- Returns:
- This Builder instance. Useful for chaining.
-
withIcon
public WelcomeImage.Builder withIcon(@NotNull @NotNull java.lang.String icon)
Sets the icon to display on the right side of the image. The value can be an available icon on the Fluxpoint API or a URL to a custom one.
You can provide an empty String to hide the icon.- Parameters:
icon
- The icon to use.- Returns:
- This Builder instance. Useful for chaining.
-
withBanner
public WelcomeImage.Builder withBanner(@NotNull @NotNull java.lang.String banner)
Sets the banner to display. The value can be an available banner on the Fluxpoint API or a URL to a custom one.
You can provide an empty String to hide the icon.- Parameters:
banner
- The banner to use.- Returns:
- This Builder instance. Useful for chaining.
-
withWelcomeColor
public WelcomeImage.Builder withWelcomeColor(@NotNull @NotNull ColorObject welcomeColor)
Sets the color for the "Welcome" text on the image.Please see the
ColorObject class
for more info on what formats are supported.- Parameters:
welcomeColor
- TheColorObject
to use for the "Welcome" text.- Returns:
- This Builder instance. Useful for chaining.
-
withUsernameColor
public WelcomeImage.Builder withUsernameColor(@NotNull @NotNull ColorObject usernameColor)
Sets the color for the username.Please see the
ColorObject class
for more info on what formats are supported.- Parameters:
usernameColor
- TheColorObject
to use for the username.- Returns:
- This Builder instance. Useful for chaining.
-
withMembersColor
public WelcomeImage.Builder withMembersColor(@NotNull @NotNull ColorObject membersColor)
Sets the color for themembers text
.Please see the
ColorObject class
for more info on what formats are supported.- Parameters:
membersColor
- TheColorObject
to use for the username.- Returns:
- This Builder instance. Useful for chaining.
-
build
public WelcomeImage build()
Creates a new, usableWelcomeImage instance
for thegetWelcomeImage
andqueueWelcomeImage
methods.An
IllegalArgumentException
may be thrown in the following cases:Username
is null or empty.Avatar
is null or empty.Background color
is null.
- Returns:
- A new
WelcomeImage instance
from this Builder.
-
-