Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an OptionHelper class with useful methods for working with options #31

Merged
merged 5 commits into from
Nov 11, 2021

Conversation

Chew
Copy link
Owner

@Chew Chew commented Oct 31, 2021

This PR adds a class for working with Options called OptionHelper.

Just opening a PR to gather thoughts/discussions on this in case there's anything else I should add here.

Currently, it adds an optX method to every returnable getAsX that allows you to provide a default value, beridding the rancid "Option may be null" warning that haunts me all the time...

Also adds a dead simple hasOption method to see if that option has been provided.

@Chew Chew added this to the 1.23.0 milestone Oct 31, 2021
@Chew Chew added the enhancement New feature or request label Nov 2, 2021
Copy link

@portlek portlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Chew Chew merged commit 6fe20b6 into master Nov 11, 2021
@Chew Chew deleted the feat/optionhelper branch November 11, 2021 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants