Skip to content

Commit fc062d3

Browse files
committed
Use descriptive variable names in documentation examples
Replace generic names (modifier, modifier2, matcher, matcher2) with descriptive names that reflect their purpose: - markAsHot, setIndustry, activateAccounts, applyTemplate - isTechAcme, isActive, isHighValueTech
1 parent 9165c93 commit fc062d3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

website/docs/api/function/MatchFields.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ IncompleteMatchFields field(String fieldPath)
1919
**Example**
2020
```apex
2121
// Chain multiple field conditions
22-
MatchFields matcher = Fn.Match.field(Account.Name).equals('Acme')
22+
MatchFields isHighValueTech = Fn.Match.field(Account.Name).equals('Acme')
2323
.also(Account.AnnualRevenue).greaterThan(100000)
2424
.field(Account.Industry).equals('Technology');
2525
2626
// Use in filtering
27-
SObjectCollection filtered = accounts.filter(matcher);
27+
SObjectCollection filtered = accounts.filter(isHighValueTech);
2828
2929
// Use with call() from SObjectPredicate interface
30-
Boolean matches = matcher.call(myAccount);
30+
Boolean matches = isHighValueTech.call(myAccount);
3131
```

website/docs/api/function/MatchRecordFields.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ public MatchRecordFields(SObject prototype)
1616
**Example**
1717
```apex
1818
// Create matcher from prototype
19-
MatchRecordFields matcher = new MatchRecordFields(new Account{
19+
MatchRecordFields isTechAcme = new MatchRecordFields(new Account{
2020
Name = 'Acme Corp',
2121
Industry = 'Technology'
2222
});
2323
2424
// Or use via Fn.Match
25-
MatchRecordFields matcher2 = Fn.Match.recordFields(new Account{Status__c = 'Active'});
25+
MatchRecordFields isActive = Fn.Match.recordFields(new Account{Status__c = 'Active'});
2626
2727
// Test records
28-
matcher.call(new Account{Name = 'Acme Corp', Industry = 'Technology'}); // true
29-
matcher.call(new Account{Name = 'Acme Corp', Industry = 'Technology', AnnualRevenue = 1000000}); // true (extra fields ignored)
30-
matcher.call(new Account{Name = 'Other Corp', Industry = 'Technology'}); // false
28+
isTechAcme.call(new Account{Name = 'Acme Corp', Industry = 'Technology'}); // true
29+
isTechAcme.call(new Account{Name = 'Acme Corp', Industry = 'Technology', AnnualRevenue = 1000000}); // true (extra fields ignored)
30+
isTechAcme.call(new Account{Name = 'Other Corp', Industry = 'Technology'}); // false
3131
```

website/docs/api/function/ModifySObject.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ ModifySObject setField(Schema.SObjectField field, Object value)
1717
**Example**
1818
```apex
1919
// Using field token
20-
ModifySObject modifier = Fn.Modify
20+
ModifySObject markAsHot = Fn.Modify
2121
.setField(Account.Status__c, 'Active')
2222
.setField(Account.Rating, 'Hot');
2323
2424
// Using string field name
25-
ModifySObject modifier2 = Fn.Modify.setField('Industry', 'Technology');
25+
ModifySObject setIndustry = Fn.Modify.setField('Industry', 'Technology');
2626
2727
// Apply to collection
28-
accounts.forEach(modifier);
28+
accounts.forEach(markAsHot);
2929
```
3030

3131
## setFields
@@ -45,9 +45,9 @@ Map<Schema.SObjectField, Object> updates = new Map<Schema.SObjectField, Object>{
4545
Account.Status__c => 'Active',
4646
Account.Rating => 'Hot'
4747
};
48-
ModifySObject modifier = Fn.Modify.setFields(updates);
48+
ModifySObject activateAccounts = Fn.Modify.setFields(updates);
4949
5050
// Using prototype SObject
5151
Account prototype = new Account(Status__c = 'Active', Rating = 'Hot');
52-
ModifySObject modifier2 = Fn.Modify.setFields(prototype);
52+
ModifySObject applyTemplate = Fn.Modify.setFields(prototype);
5353
```

0 commit comments

Comments
 (0)