Package io.github.mqzn.commands.help
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>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mqzn.commands.help.CommandHelpStyle
CommandHelpStyle.Builder<S>, CommandHelpStyle.ImmutableHelpStyle<S> -
Constructor Summary
ConstructorsConstructorDescriptionImmutableHelpStyle(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 aImmutableHelpStylerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.@NotNull net.kyori.adventure.text.TextComponentThe header of the help topicnet.kyori.adventure.text.format.StyleReturns the value of thelineStylerecord component.Function<CommandSyntax<S>,net.kyori.adventure.text.format.Style> Returns the value of thesyntaxStylerecord component.@NotNull net.kyori.adventure.text.format.StylesyntaxStyle(@NotNull CommandSyntax<S> syntax) The style of the syntax of a commandfinal StringtoString()Returns a string representation of this record class.
-
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 aImmutableHelpStylerecord class.- Parameters:
lineStyle- the value for thelineStylerecord componentsyntaxStyle- the value for thesyntaxStylerecord componentheader- the value for theheaderrecord component
-
-
Method Details
-
header
The header of the help topic- Specified by:
headerin interfaceCommandHelpStyle<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:
syntaxStylein interfaceCommandHelpStyle<S>- Parameters:
syntax- the syntax of a command- Returns:
- The style of the syntax of a command
-
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). -
lineStyle
public net.kyori.adventure.text.format.Style lineStyle()Returns the value of thelineStylerecord component.- Specified by:
lineStylein interfaceCommandHelpStyle<S>- Returns:
- the value of the
lineStylerecord component - See Also:
-
Style
-
syntaxStyle
Returns the value of thesyntaxStylerecord component.- Returns:
- the value of the
syntaxStylerecord component
-
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-