JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
enhancement_small.png
CLOSED  Enhancement JPPF-417  -  Make the setter methods in TypedProperties fluent
Posted Oct 09, 2015 - updated Oct 09, 2015
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Enhancement
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Configuration
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Targetted for
    icon_milestones.png JPPF 5.1
Issue description
Currently, the setter methods in the TypedProperties class, such as setInt("answer.to.everything", 42) have a void return type. We propose to make them return the TypedProperties object from which they are called, which will allow setting multiple properties of diffferent types in a single call chain. For example:
// get the configuration
TypedProperties config = JPPFConfiguration.getProperties();
// set the connection properties programmatically
config.setBoolean("jppf.discovery.enabled", false)
  .setString("jppf.drivers", "driver1")
  .setString("driver1.jppf.server.host", "www.myhost.com")
  .setInt("driver1.jppf.server.port", 11111);
This should have no impact on existing code, since we're not actually changing the signature of these methods, not even if they are accessed via reflection.

#3
Comment posted by
 lolo4j
Oct 09, 10:22
Implemented in trunk revision 3849