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

StrProp.startsWithOneOf(...) would be very useful #680

Open
eeverman opened this issue Nov 4, 2021 · 0 comments
Open

StrProp.startsWithOneOf(...) would be very useful #680

eeverman opened this issue Nov 4, 2021 · 0 comments
Labels
Milestone

Comments

@eeverman
Copy link
Owner

eeverman commented Nov 4, 2021

Is your feature request related to a problem? Please describe.
When you need to specify a url, it would be nice to explicitly allow it to start with "http://" or "https://".
Its possible to do that with a regex, but its a relatively common need. Similarly, to specify a set of possible input files of select types, it would be nice to specify file endings, e.g. .png, .jpg, .gif.

Describe the solution you'd like
Add validators that are exposed as methods like this:

  • startsWithOneOf(String[])
  • startsWithOneOfIgnoringCase(String[])
  • endsWithOneOf(String[])
  • endsWithOneOfIgnoringCase(String[])

Notes for Hacktoberfest

These are some relatively simple additions to some existing classes. The new validations would be added to the StringValidator. Each type of validation is a subclass of that class and is implemented as an interclass within it.

If you are unfamiliar with the project, please look over the AndHow Site to get a basic understanding of what AndHow is, in particular, how Properties are used.

For this task:

  • Be sure to work from the main branch
  • Add the described validators to the StringValidator class, following the naming conventions of that class.
  • Add methods to build those classes to the StrProp.StrBuilder class. The methods added to this builder should match the names listed above, e.g. startsWithOneOf(String[])
  • Add tests for the new code, following existing examples.
@eeverman eeverman added this to the 0.5.1 milestone Nov 4, 2021
@eeverman eeverman modified the milestones: 1.5.1, Next Next Dot Oct 11, 2022
@eeverman eeverman added help wanted good first issue Hacktoberfest Anyone can take - Especially Hacktober people labels Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant