Questions tagged [casting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
584 views

How to sort a custom list of Notes and Attachments by LastModifiedDate

In my VF Page I have been asked to show a list of all the Notes and Attachments in one table, and sorted by the common LastModifiedDate ... So I have a wrapper class in my custom controller: public ...
3
votes
1answer
239 views

Notes & Attachments Wrapper class not sorting by LastModifiedDate correctly

I am using the below code with the Comparable interface to build a combined list of all the attachments and notes on a record, sorted in descending order of LastModifiedDate (in constructor of main ...
10
votes
2answers
2k views

What is the best way to cast/convert Map<String, SObject> to Map<Object, Object> and back again?

To reduce code duplication, at the risk of type safety, I have some method: public Map<Object, Object> doSomething(Map<Object, Object> inputMap) { Map<Object, Object> outputMap; ...
9
votes
1answer
380 views

How is it possible to cast Set to (Iterable<String>)?

I am pretty sure that I am missing something obvious here, but I still cannot grasp the casting operation in the following piece of code: Set<String> mySet = new Set<String>(); mySet.add('...