commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13771] New: - Additional Lang Method Suggestions
Date Fri, 18 Oct 2002 17:33:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13771>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13771

Additional Lang Method Suggestions

           Summary: Additional Lang Method Suggestions
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: kenfitzpatrick@yahoo.com


I love Commons/Lang!  I've been replacing my own implementations to yours.

Here are some unique ones that I haven't been able to map yet.  Please consider 
adding them to the Commons/Lang component:
getClassNameOnly( Object o ) : String /** Returns only the final node of the 
class name (ex: return "String" from instance of "java.lang.String"). Useful 
for formatting error messages */
getNumerics( String s ) : String /** Returns only the numeric contents of s */
getProperCase( String s ) : String /** Returns proper-case equivalent of the 
contents of s (ex: return "Bob Smith" from "bob smith") */
getBoolean( String s ) : boolean /** Returns the boolean equivalent of s (ex: 
map boolean equivalents of strings: t/f, true/false, True/False, y/n, Yes/No, 
1/0, On/Off, +/-,  Yep/Nope, etc.) */
getTrueOrFalse( boolean b ) : String /** Returns the equivalent of b as 
either "True" or "False" */  ... other methods to support inverse of previous 
method (ex: getYesOrNo, getOnOrOff, etc.)
getSqlEscapedColumnValue( String s ) : String /** Returns an SQL-based escaped 
equivalent of s (ex: map "Bob's" to "Bob''s", etc.) */ 
getSqlWhereEqualsColumnValueOrIsNull( String s ) : String /** Returns "= '[s]'" 
(if s != null) or "is null" (if s == null) for safely building SQL Where Clause 
Predicates like "ColumnName = 'Bob'" or "ColumnName is null" */
getSqlColumnValueOrNull( String s ) : String /** Returns s or the String "null" 
such that the returned value can be used to safely build an SQL Update.Set 
Clause, Insert.Values Clause, etc. as "Set Col=[s]" where s is the value 
returned from this method ... Overloads for Date, Integer, ... */ 

Not one to drop requests and then jump ship ... I am willing to offer 
implementations of any of these, if needed.

Thanks!!
Ken Fitzpatrick

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message