Skip to main content

Timeline for Does apex support generics?

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Jul 21, 2017 at 19:49 comment added Adrian Larson Are you sure it works with all primitives? I'm surprised you got it to work with type coercion on Date/Datetime.
Jul 21, 2017 at 17:43 comment added sfdcfox @NickKahn If you're binding to a String, it'll be a string. Your controller itself should be converting the value to the appropriate type with Decimal.valueOf, Date.valueOf, etc. This is only one part of the solution for what you're attempting to do.
Jul 21, 2017 at 17:15 comment added Nick One thing I found is that if I'm passing Date it treating as String and hence its adding the singleQuotes, and I try to add one more if(FieldValue instanceOf Date) { return FieldName + Operator + FieldValue; } but its not exuecting that if condition, any idea?
Jul 21, 2017 at 14:15 vote accept Nick
Jul 21, 2017 at 14:08 comment added sfdcfox @NickKahn Yeah, I should have modified that. I went ahead and edited in a version that should work for most purposes.
Jul 21, 2017 at 14:08 history edited sfdcfox CC BY-SA 3.0
added 329 characters in body
Jul 21, 2017 at 14:01 comment added Nick one question how will this getSOQLCriteria method will take care if the f_value is integer, its enclosing a single quote
Jul 21, 2017 at 2:10 comment added martin Interesting. It looks like the + operator for string concatenation can handle Object type arguments and somehow manages to convert them to strings.
Jul 21, 2017 at 1:59 history answered sfdcfox CC BY-SA 3.0