Class ByteAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.ByteAdapter
- All Implemented Interfaces:
TypeAdapter<Byte>
,BiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<Byte>>
Type adapter for byte values.
-
Constructor Details
-
ByteAdapter
public ByteAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Byte> apply(@NotNull @NotNull String raw, @NotNull @NotNull net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent event) Attempts to parse a String to a Byte.- Specified by:
apply
in interfaceBiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<Byte>> - Specified by:
apply
in interfaceTypeAdapter<Byte>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed Byte or an empty Optional if the parsing fails
-