Record Class WebHook

java.lang.Object
java.lang.Record
io.github._4drian3d.jdwebhooks.WebHook
Record Components:
content - the message content of this webhook
username - the username to overwrite the webhook name
avatarURL - the avatar icon url
tts -
embeds - the embeds to attach to this webhook
allowedMentions - if this webhook can mention users
threadName - 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.
  • 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 a WebHook record class.
      Parameters:
      content - the value for the content record component
      username - the value for the username record component
      avatarURL - the value for the avatarURL record component
      tts - the value for the tts record component
      embeds - the value for the embeds record component
      allowedMentions - the value for the allowedMentions record component
      threadName - the value for the threadName record component
  • Method Details

    • builder

      public static WebHook.Builder builder()
      Creates a new WebHook Builder.
      Returns:
      a new WebHook builder
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • content

      @NotNull public @NotNull String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • username

      @Nullable public @Nullable String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • avatarURL

      @Nullable public @Nullable String avatarURL()
      Returns the value of the avatarURL record component.
      Returns:
      the value of the avatarURL record component
    • tts

      @Nullable public @Nullable Boolean tts()
      Returns the value of the tts record component.
      Returns:
      the value of the tts record component
    • embeds

      @Nullable public @Nullable List<Embed> embeds()
      Returns the value of the embeds record component.
      Returns:
      the value of the embeds record component
    • allowedMentions

      @Nullable public @Nullable Boolean allowedMentions()
      Returns the value of the allowedMentions record component.
      Returns:
      the value of the allowedMentions record component
    • threadName

      @Nullable public @Nullable String threadName()
      Returns the value of the threadName record component.
      Returns:
      the value of the threadName record component