commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wooten (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LANG-601) Add Builder Interface / Update Builders to Implement It
Date Sat, 06 Mar 2010 06:22:27 GMT

     [ https://issues.apache.org/jira/browse/LANG-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Wooten updated LANG-601:
--------------------------------

    Attachment: commons-lang-builder.patch

The attached patch was created with Eclipse. The patch includes a new Builder interface in
the builder package, and also updates all of the *Builder classes to implement this new interface.
Additional test cases were added to test that the build() methods return the appropriate results.

> Add Builder Interface / Update Builders to Implement It
> -------------------------------------------------------
>
>                 Key: LANG-601
>                 URL: https://issues.apache.org/jira/browse/LANG-601
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.builder.*
>    Affects Versions: 3.0
>         Environment: Java 1.5+
>            Reporter: Michael Wooten
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: commons-lang-builder.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I propose the addition of a Builder<T> interface that can be used to identify a
class as a builder of a concrete type of object. The interface would provide the following
method:
> T build();
> There are many examples of classes that define a build() method, including BasicThreadFactory.Builder.
By implementing this interface, the classes would explicitly indicate the object type they
are capable of building. Furthermore, the interface can provide documentation on the best
approach to implementing builder classes. 
> I additionally suggest that the existing builder classes (CompareToBuilder, EqualsBuilder,
HashCodeBuilder, and ToStringBuilder) implement this interface. No other changes would need
to be made, since the class's build() method would only need to return the result of the current
"build" method for each of those classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message