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