Skip to content

Commit

Permalink
Remove asSet as it appears to no longer be working as expected. asLis…
Browse files Browse the repository at this point in the history
…t can be passed to a set constructor instead.
  • Loading branch information
ipavlic committed Jul 5, 2024
1 parent 2624285 commit 0e584de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 0 additions & 10 deletions force-app/main/default/classes/collection/SObjectCollection.cls
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ public with sharing class SObjectCollection {
return typedList;
}

public Set<SObject> asSet() {
return new Set<SObject>(this.records);
}

public Set<SObject> asSet(Type setType) {
Set<SObject> typedSet = (Set<SObject>) setType.newInstance();
typedSet.addAll(this.records);
return typedSet;
}

public Map<Id, SObject> asMap() {
return new Map<Id, SObject>(this.records);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ private class SObjectCollectionTest {
@IsTest
private static void collectionCanBeInstantiatedFromAList() {
SObjectCollection c = SObjectCollection.of(new List<Account>{new Account(Name = 'Foo'), new Account(Name = 'Bar')});
System.Assert.isNotNull(c);
}

@IsTest
Expand Down

0 comments on commit 0e584de

Please sign in to comment.