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