Class ShortAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.ShortAdapter
- All Implemented Interfaces:
TypeAdapter<Short>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<Short>>
Type adapter for short values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(@NotNull String raw, @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to a Short.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
-
ShortAdapter
public ShortAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Short> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to a Short.- Specified by:
apply
in interfaceBiFunction<String,
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
-