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

Few enhancements in the builder framework #941

Merged
merged 1 commit into from
May 18, 2020

Conversation

anjalshireesh
Copy link
Contributor

@anjalshireesh anjalshireesh commented May 18, 2020

  • Infer the type of the Args class by looking it up through reflection
    (getEnclosingClass()), so that there is no need for concrete builder
    classes to implement the build() method.

  • Change the generic type notations <T, B> to <B, A> to make them
    more intuitive (B -> Builder and A -> Args)

  • When inheriting from a parent builder class in an abstract builder
    class like BucketArgs.Builder, pass the type parameters of the current
    class (<B, A>) as is. This ensures that the builder methods,
    irrespective of what order they're called in, will always return an
    object with type of the original builder class.

@nitisht nitisht requested review from sinhaashish and balamurugana and removed request for sinhaashish May 18, 2020 04:48
@anjalshireesh anjalshireesh force-pushed the builder-enhancements branch from bbabfa5 to 2d08918 Compare May 18, 2020 05:48
- Infer the type of the Args class by looking it up through reflection
(`getEnclosingClass()`), so that there is no need for concrete builder
classes to implement the `build()` method.

- Change the generic type notations `<T, B>` to `<B, A>` to make them
more intuitive (`B -> Builder` and `A -> Args`)

- When inheriting from a parent builder class in an abstract builder
class like `BucketArgs.Builder`, pass the type parameters of the current
class (`<B, A>`) as is. This ensures that the builder methods,
irrespective of what order they're called in, will always return an
object with type of the original builder class.
@anjalshireesh anjalshireesh force-pushed the builder-enhancements branch from 2d08918 to 18debd6 Compare May 18, 2020 05:53
Copy link
Member

@balamurugana balamurugana left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@sinhaashish sinhaashish left a comment

Choose a reason for hiding this comment

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

LGTM

@anjalshireesh anjalshireesh changed the title Couple of enhancements in the builder framework Few enhancements in the builder framework May 18, 2020
@nitisht nitisht merged commit 7369e79 into minio:master May 18, 2020
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.

4 participants