poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53625] New: setters should return "this" rather than void
Date Mon, 30 Jul 2012 19:58:12 GMT

          Priority: P2
            Bug ID: 53625
          Assignee: dev@poi.apache.org
           Summary: setters should return "this" rather than void
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: scott@xigole.com
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: POI Overall
           Product: POI

This is more of a change request than a bug.

It would be nice if setters across the board could return "this".  By changing
the code this way instead of doing:

Cell myCell = row.createCell();
myCell.setCellStyle( myStyle );
RichTextString rts = createHelper.createRichTextString( "hello );
rts.applyFont( boldFont );
myCell.setCellFont( rts );

I could do:

Cell myCell = row.createCell()
                 .setCellStyle( myStyle )
                 .setCellFont( createHelper.createRichTextString( "hello" )
                               .applyFont( boldFont ) );

The previous code would continue to work but if you prefer a more compact
version with fewer intermediate variables a change from void setters would
allow this.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message