Class ThreadChannelAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.ThreadChannelAdapter
- All Implemented Interfaces:
TypeAdapter<ThreadChannel>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<ThreadChannel>>
Type adapter for JDAs
ThreadChannel
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional
<ThreadChannel> apply
(@NotNull String raw, @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aThreadChannel
.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
-
ThreadChannelAdapter
public ThreadChannelAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<ThreadChannel> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aThreadChannel
. Accepts both the channel id and name.- Specified by:
apply
in interfaceBiFunction<String,
GenericInteractionCreateEvent, Optional<ThreadChannel>> - Specified by:
apply
in interfaceTypeAdapter<ThreadChannel>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed
ThreadChannel
or an empty Optional if the parsing fails
-