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