Record Class CommandHelpStyle.ImmutableHelpStyle<S>

java.lang.Object
java.lang.Record
io.github.mqzn.commands.help.CommandHelpStyle.ImmutableHelpStyle<S>
All Implemented Interfaces:
CommandHelpStyle<S>
Enclosing interface:
CommandHelpStyle<S>

public static record CommandHelpStyle.ImmutableHelpStyle<S>(net.kyori.adventure.text.format.Style lineStyle, Function<CommandSyntax<S>,net.kyori.adventure.text.format.Style> syntaxStyle, Function<String,net.kyori.adventure.text.TextComponent> header) extends Record implements CommandHelpStyle<S>
  • Constructor Details

    • ImmutableHelpStyle

      public ImmutableHelpStyle(net.kyori.adventure.text.format.Style lineStyle, Function<CommandSyntax<S>,net.kyori.adventure.text.format.Style> syntaxStyle, Function<String,net.kyori.adventure.text.TextComponent> header)
      Creates an instance of a ImmutableHelpStyle record class.
      Parameters:
      lineStyle - the value for the lineStyle record component
      syntaxStyle - the value for the syntaxStyle record component
      header - the value for the header record component
  • Method Details

    • header

      @NotNull public @NotNull net.kyori.adventure.text.TextComponent header(String label)
      The header of the help topic
      Specified by:
      header in interface CommandHelpStyle<S>
      Parameters:
      label - the command label (name)
      Returns:
      the header of the help topic
    • syntaxStyle

      @NotNull public @NotNull net.kyori.adventure.text.format.Style syntaxStyle(@NotNull @NotNull CommandSyntax<S> syntax)
      The style of the syntax of a command
      Specified by:
      syntaxStyle in interface CommandHelpStyle<S>
      Parameters:
      syntax - the syntax of a command
      Returns:
      The style of the syntax of a command
    • 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.
    • lineStyle

      public net.kyori.adventure.text.format.Style lineStyle()
      Returns the value of the lineStyle record component.
      Specified by:
      lineStyle in interface CommandHelpStyle<S>
      Returns:
      the value of the lineStyle record component
      See Also:
      • Style
    • syntaxStyle

      public Function<CommandSyntax<S>,net.kyori.adventure.text.format.Style> syntaxStyle()
      Returns the value of the syntaxStyle record component.
      Returns:
      the value of the syntaxStyle record component
    • header

      public Function<String,net.kyori.adventure.text.TextComponent> header()
      Returns the value of the header record component.
      Returns:
      the value of the header record component