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

Introducing the ConfigurationBuilder with support to Properties file #2

Closed
8 tasks done
oswaldobapvicjr opened this issue Jul 16, 2021 · 0 comments · Fixed by #3
Closed
8 tasks done

Introducing the ConfigurationBuilder with support to Properties file #2

oswaldobapvicjr opened this issue Jul 16, 2021 · 0 comments · Fixed by #3
Assignees
Labels
0.1.x The target Confectory version enhancement New feature or request

Comments

@oswaldobapvicjr
Copy link
Owner

oswaldobapvicjr commented Jul 16, 2021

New feature

Proposed solution

Introducing the new project setup with capabilities to handle local properties files from the classpath, according to the example:

Configuration config = Configuration.<Properties>builder()
                                .source(new ClasspathFileSource<>("my-props.properties"))
                                .mapper(new PropertiesMapper())
                                .build();

config.getBooleanProperty("web.enable"); // true
config.getStringProperty("web.host");    // "localhost"
config.getIntProperty("web.port");       // 1910

The following requirements shall be addressed in this issue:

  • Add a new parent POM confectory-base
  • Add a new module confectory-core
  • New Source interface, with a concrete ClasspathFileSource implementation for local classpath resources
  • New concrete Source implementation FileSource with built-in environment variable replacement
  • New Mapper interface, with a concrete PropertiesMapper implementation for loading Properties files
  • New Reader interface, with a concrete PropertiesReader implementation
  • New Configuration and ConfigurationBuilder objects with capabilities to handle properties files
  • Add logs using Log4j2

Additional details

  • The code shall be developed in a dedicated branch, with the prefix issue/ followed by the issue number (e.g.: issue/0002)

Quality criteria

The following criteria will be observed during the Code Review:

Code coverage

  • The produced code shall be secured by unit tests.
  • Test coverage shall remain the same or increase.

Documentation

  • All methods shall be documented with Javadoc, providing examples of usage.
  • Javadoc pages shall be compilable with no errors or warnings
  • README.md shall be updated if applicable
@oswaldobapvicjr oswaldobapvicjr self-assigned this Jul 16, 2021
@oswaldobapvicjr oswaldobapvicjr added the enhancement New feature or request label Jul 16, 2021
oswaldobapvicjr added a commit that referenced this issue Jul 16, 2021
@oswaldobapvicjr oswaldobapvicjr linked a pull request Jul 16, 2021 that will close this issue
oswaldobapvicjr added a commit that referenced this issue Jul 19, 2021
* First draft of #2

* Improvements and some missing Javadocs

* Minor improvements

* New FileSource with expander and Optional configuration

* Simplifying the Mappers, adding more JUnits

* Adding Javadocs

* Adding logs to Source implementations

* More Javadocs and JUnits
@oswaldobapvicjr oswaldobapvicjr added the 0.1.x The target Confectory version label Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.1.x The target Confectory version enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant