Record Class Argument
java.lang.Object
java.lang.Record
de.chojo.jdautil.interactions.slash.Argument
public record Argument(OptionType type, String name, String description, boolean required, boolean autoComplete, @NotNull Consumer<OptionData> min, @NotNull Consumer<OptionData> max)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionArgument(OptionType type, String name, String description, boolean required, boolean autoComplete, @NotNull Consumer<OptionData> min, @NotNull Consumer<OptionData> max) Creates an instance of aArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArgumentBuilderattachment(String name, String description) booleanReturns the value of theautoCompleterecord component.static ArgumentBuilderstatic ArgumentBuilderImplbuilder(OptionType type, String name, String description) static ArgumentBuilderdata()data(Slash slash, Group group, SubCommand subCommand, ILocalizer localizer) data(Slash slash, SubCommand subCommand, ILocalizer localizer) data(Slash slash, ILocalizer localizer) data(ILocalizer localizer) Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static IntegerArgumentBuilder@NotNull Consumer<OptionData> max()Returns the value of themaxrecord component.static ArgumentBuildermentionable(String name, String description) @NotNull Consumer<OptionData> min()Returns the value of theminrecord component.name()Returns the value of thenamerecord component.static NumberArgumentBuilderstatic Argumentof(OptionType type, String name, String description) Deprecated, for removal: This API element is subject to removal in a future version.static Argumentof(OptionType type, String name, String description, boolean required) Deprecated, for removal: This API element is subject to removal in a future version.Usebuilder(OptionType, String, String)insteadbooleanrequired()Returns the value of therequiredrecord component.static ArgumentBuilderstatic StringArgumentBuilderDeprecated, for removal: This API element is subject to removal in a future version.Replaced bytext(String, String)static StringArgumentBuilderfinal StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.static ArgumentBuilder
-
Constructor Details
-
Argument
public Argument(OptionType type, String name, String description, boolean required, boolean autoComplete, @NotNull @NotNull Consumer<OptionData> min, @NotNull @NotNull Consumer<OptionData> max) Creates an instance of aArgumentrecord class.- Parameters:
type- the value for thetyperecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentrequired- the value for therequiredrecord componentautoComplete- the value for theautoCompleterecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
of
@Deprecated(forRemoval=true) public static Argument of(OptionType type, String name, String description, boolean required) Deprecated, for removal: This API element is subject to removal in a future version.Usebuilder(OptionType, String, String)instead -
of
@Deprecated(forRemoval=true) public static Argument of(OptionType type, String name, String description) Deprecated, for removal: This API element is subject to removal in a future version.Usebuilder(OptionType, String, String)instead -
builder
-
string
@Deprecated(forRemoval=true) public static StringArgumentBuilder string(String name, String description) Deprecated, for removal: This API element is subject to removal in a future version.Replaced bytext(String, String) -
text
-
integer
-
bool
-
user
-
role
-
attachment
-
channel
-
number
-
mentionable
-
data
-
data
-
data
-
data
-
data
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-
autoComplete
public boolean autoComplete()Returns the value of theautoCompleterecord component.- Returns:
- the value of the
autoCompleterecord component
-
min
Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
builder(OptionType, String, String)instead