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 aImmutableHelpStyle
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.header()
Returns the value of theheader
record component.@NotNull net.kyori.adventure.text.TextComponent
The header of the help topicnet.kyori.adventure.text.format.Style
Returns the value of thelineStyle
record component.Function<CommandSyntax<S>,
net.kyori.adventure.text.format.Style> Returns the value of thesyntaxStyle
record component.@NotNull net.kyori.adventure.text.format.Style
syntaxStyle
(@NotNull CommandSyntax<S> syntax) The style of the syntax of a commandfinal String
toString()
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 aImmutableHelpStyle
record class.- Parameters:
lineStyle
- the value for thelineStyle
record componentsyntaxStyle
- the value for thesyntaxStyle
record componentheader
- the value for theheader
record component
-
-
Method Details
-
header
The header of the help topic- Specified by:
header
in 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:
syntaxStyle
in 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 thelineStyle
record component.- Specified by:
lineStyle
in interfaceCommandHelpStyle<S>
- Returns:
- the value of the
lineStyle
record component - See Also:
-
Style
-
syntaxStyle
Returns the value of thesyntaxStyle
record component.- Returns:
- the value of the
syntaxStyle
record component
-
header
Returns the value of theheader
record component.- Returns:
- the value of the
header
record component
-