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

Teach Factory to create instances with arguments #9

Merged
merged 18 commits into from
Jul 2, 2024

Conversation

alexander-yevsyukov
Copy link
Contributor

This PR extends the Factory class with the ability to create class instances passing given arguments to constructors.

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.67%. Comparing base (5f4fb68) to head (8fa3e0f).

Current head 8fa3e0f differs from pull request most recent head a22d360

Please upload reports for the commit a22d360 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##             master       #9      +/-   ##
============================================
+ Coverage     85.16%   85.67%   +0.51%     
- Complexity       99      102       +3     
============================================
  Files            13       13              
  Lines           364      391      +27     
  Branches         35       44       +9     
============================================
+ Hits            310      335      +25     
- Misses           43       44       +1     
- Partials         11       12       +1     

@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 1, 2024
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review July 1, 2024 21:35
Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

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

@alexander-yevsyukov LGTM with some minor comments.

* if the specified class does not have a parameterless
* constructors. Note that nested classes fall under this case
* if the specified class does not have a parameterless constructor.
* Note that nested classes fall under this case
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put a period at the end?

/**
* Checks if this [KVisibility] is [public][KVisibility.PUBLIC].
*/
private val KVisibility?.isPublic: Boolean
get() = this == KVisibility.PUBLIC

/**
* Tells if this class originates in the Kotlin code, returning `false` for classes
Copy link
Contributor

Choose a reason for hiding this comment

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

"from the Kotlin code"?

public WithParametersJava(String str, @Nullable Object any, Iterable<String> list) {
// Do nothing.
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's kill this line.

@alexander-yevsyukov alexander-yevsyukov merged commit 34572e7 into master Jul 2, 2024
6 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the factory-with-args branch July 2, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants