Class IntegerAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.IntegerAdapter
- All Implemented Interfaces:
TypeAdapter<Integer>
,BiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<Integer>>
Type adapter for integer values.
-
Constructor Details
-
IntegerAdapter
public IntegerAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Integer> apply(@NotNull @NotNull String raw, @NotNull @NotNull net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent event) Attempts to parse a String to an Integer.- Specified by:
apply
in interfaceBiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<Integer>> - Specified by:
apply
in interfaceTypeAdapter<Integer>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed Integer or an empty Optional if the parsing fails
-