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