Class FloatAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.FloatAdapter
- All Implemented Interfaces:
TypeAdapter<Float>
,BiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<Float>>
Type adapter for float values.
-
Constructor Details
-
FloatAdapter
public FloatAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Float> apply(@NotNull @NotNull String raw, @NotNull @NotNull net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent event) Attempts to parse a String to a Float.- Specified by:
apply
in interfaceBiFunction<String,
net.dv8tion.jda.api.events.interaction.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
-