Closed portlek closed 2 years ago
Kinda pointless to have imo
it's a utility class so idk. but the purpose of this type of classes is this actually :d
A simple return OptionMapping == null ? defValue : OptionMapping#asWhatever()
is sufficient enough.
Creating an Optional just for this is a waste of time and resources.
Also,there can never be more than one OptionMapping with a specific key.
if you think on this class, Optional.ofNullable(event.getOption("optionName"))
is also enough for each opt**** methods. my point is this class called helper class which can have helper methods for every option mapping related methods.
To my knowledge, you can't have the same method name + same parameters with a different return type.
As has been stated, I don't really see the point of this. There's a whole debate of whether Optionals are good or not, I'm on the side of don't really care but optX already does everything I assume you'd want (you're guaranteed an option) which was the ultimate point of the thing.
Issue Checklist
Affected Modules
Command
Description
Add java.util.Optional return type for each opt*** methods. For example;