Class LongAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.LongAdapter
- All Implemented Interfaces:
TypeAdapter<Long>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<Long>>
Type adapter for long values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(@NotNull String raw, @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to a Long.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
LongAdapter
public LongAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Long> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to a Long.- Specified by:
apply
in interfaceBiFunction<String,
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
-