java.lang.Object
java.lang.Record
io.github._4drian3d.jdwebhooks.WebHook
- Record Components:
content- the message content of this webhookusername- the username to overwrite the webhook nameavatarURL- the avatar icon urltts-embeds- the embeds to attach to this webhookallowedMentions- if this webhook can mention usersthreadName- the thread to be created from this webhook
public record WebHook(@NotNull String content, @Nullable String username, @Nullable String avatarURL, @Nullable Boolean tts, @Nullable List<Embed> embeds, @Nullable Boolean allowedMentions, @Nullable String threadName)
extends Record
Object containing all available items to display in a Discord WebHook.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable BooleanReturns the value of theallowedMentionsrecord component.@Nullable StringReturns the value of theavatarURLrecord component.static WebHook.Builderbuilder()Creates a new WebHook Builder.@NotNull Stringcontent()Returns the value of thecontentrecord component.embeds()Returns the value of theembedsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of thethreadNamerecord component.final StringtoString()Returns a string representation of this record class.@Nullable Booleantts()Returns the value of thettsrecord component.@Nullable Stringusername()Returns the value of theusernamerecord component.
-
Constructor Details
-
WebHook
public WebHook(@NotNull @NotNull String content, @Nullable @Nullable String username, @Nullable @Nullable String avatarURL, @Nullable @Nullable Boolean tts, @Nullable @Nullable List<Embed> embeds, @Nullable @Nullable Boolean allowedMentions, @Nullable @Nullable String threadName) Creates an instance of aWebHookrecord class.- Parameters:
content- the value for thecontentrecord componentusername- the value for theusernamerecord componentavatarURL- the value for theavatarURLrecord componenttts- the value for thettsrecord componentembeds- the value for theembedsrecord componentallowedMentions- the value for theallowedMentionsrecord componentthreadName- the value for thethreadNamerecord component
-
-
Method Details
-
builder
Creates a new WebHook Builder.- Returns:
- a new WebHook builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
avatarURL
Returns the value of theavatarURLrecord component.- Returns:
- the value of the
avatarURLrecord component
-
tts
Returns the value of thettsrecord component.- Returns:
- the value of the
ttsrecord component
-
embeds
Returns the value of theembedsrecord component.- Returns:
- the value of the
embedsrecord component
-
allowedMentions
Returns the value of theallowedMentionsrecord component.- Returns:
- the value of the
allowedMentionsrecord component
-
threadName
Returns the value of thethreadNamerecord component.- Returns:
- the value of the
threadNamerecord component
-