Enum Class DiscordComponentSerializer

java.lang.Object
java.lang.Enum<DiscordComponentSerializer>
net.lucypoulton.squirtgun.discord.adventure.DiscordComponentSerializer
All Implemented Interfaces:
Serializable, Comparable<DiscordComponentSerializer>, Constable, net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,​net.kyori.adventure.text.TextComponent,​String>

public enum DiscordComponentSerializer extends Enum<DiscordComponentSerializer> implements net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,​net.kyori.adventure.text.TextComponent,​String>
Serialises Components into Discord-formatted markdown. Discord's text format is far less rich than Minecraft's, so some information, such as colour and events, is discarded.
  • Enum Constant Details

  • Method Details

    • values

      public static DiscordComponentSerializer[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DiscordComponentSerializer valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • deserialize

      @NotNull public @NotNull net.kyori.adventure.text.TextComponent deserialize(@NotNull @NotNull String input)
      Specified by:
      deserialize in interface net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,​net.kyori.adventure.text.TextComponent,​String>
    • serialize

      @NotNull public @NotNull String serialize(@NotNull @NotNull net.kyori.adventure.text.Component component)
      Specified by:
      serialize in interface net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,​net.kyori.adventure.text.TextComponent,​String>