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