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