Class ByteAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.ByteAdapter
- All Implemented Interfaces:
TypeAdapter<Byte>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<Byte>>
Type adapter for byte values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(@NotNull String raw, @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to a Byte.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
-
ByteAdapter
public ByteAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Byte> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to a Byte.- Specified by:
apply
in interfaceBiFunction<String,
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
-