Skip to content

Commit bd2159b

Browse files
committed
Update documentation
1 parent c0a7a90 commit bd2159b

File tree

8 files changed

+84
-84
lines changed

8 files changed

+84
-84
lines changed

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55

66
Apex FP provides functional constructs for `SObject` collections!
77

8+
## Read the documentation
9+
10+
<a href="https://www.apexfp.org">Apex FP documentation</a>
11+
12+
## Deploy to Salesforce
13+
14+
<a href="https://githubsfdeploy.herokuapp.com?owner=ipavlic&repo=apex-fp&ref=main">
15+
<img alt="Deploy to Salesforce"
16+
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/deploy.png">
17+
</a>
18+
819
## Examples
920

1021
### Filter
@@ -92,17 +103,4 @@ OptionalDecimal min = SObjectCollection.of(opportunities).mapToDecimal(Opportuni
92103

93104
```apex
94105
OptionalDecimal max = SObjectCollection.of(opportunities).mapToDecimal(Opportunity.Amount).max();
95-
```
96-
97-
Find more examples <a href="https://apexfp.org/examples">in the documentation</a>.
98-
99-
## Deploy to Salesforce
100-
101-
<a href="https://githubsfdeploy.herokuapp.com?owner=ipavlic&repo=apex-fp&ref=main">
102-
<img alt="Deploy to Salesforce"
103-
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/deploy.png">
104-
</a>
105-
106-
## Read the documentation
107-
108-
<a href="https://www.apexfp.org">Apex FP documentation</a>
106+
```

force-app/main/default/classes/function/MatchFieldCondition.cls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class MatchFieldCondition {
1313
this.value = value;
1414
}
1515

16+
private class SetComparison()
17+
1618
public Boolean isSatisfied(SObject record) {
1719
Object fieldValue = fieldReader.read(record, fieldPath);
1820
switch on relation {

website/docs/api/function/AssignToSObject.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

website/docs/api/function/FieldsMatch.md

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# IncompleteFieldsMatch
1+
# IncompleteMatchFields
22

3-
`IncompleteFieldsMatch` starts the fluent interface for building a [`FieldsMatch`](FieldsMatch). Adding a condition through methods on the `IncompleteFieldsMatch` yields a `FieldsMatch`, which is an [`SObjectPredicate`](SObjectPredicate). The process can be continued to add more field conditions.
3+
`IncompleteMatchFields` starts the fluent interface for building a [`MatchFields`](MatchFields). Adding a condition through methods on the `IncompleteMatchFields` yields a `MatchFields`, which is an [`SObjectPredicate`](SObjectPredicate). The process can be continued to add more field conditions.
44

55
## equals (alias eq)
66

77
Defines an equality comparison condition for the current field.
88

99
**Signature**
1010
```
11-
FieldsMatch equals(Object value)
11+
MatchFields equals(Object value)
1212
```
1313

1414
**Signature**
1515
```
16-
FieldsMatch eq(Object value)
16+
MatchFields eq(Object value)
1717
```
1818
## notEquals (alias neq)
1919

2020
Defines an inequality comparison condition for the current field.
2121

2222
**Signature**
2323
```
24-
FieldsMatch notEquals(Object value)
24+
MatchFields notEquals(Object value)
2525
```
2626

2727
## lessThan (alias lt)
@@ -30,7 +30,7 @@ Defines a less than comparison condition for the current field.
3030

3131
**Signature**
3232
```
33-
FieldsMatch lessThan(Object value)
33+
MatchFields lessThan(Object value)
3434
```
3535

3636
## lessThanOrEquals (alias leq)
@@ -39,7 +39,7 @@ Defines a less than or equals condition for the current field.
3939

4040
**Signature**
4141
```
42-
FieldsMatch lessThanOrEquals(Object value)
42+
MatchFields lessThanOrEquals(Object value)
4343
```
4444

4545
## greaterThan (alias gt)
@@ -48,7 +48,7 @@ Defines a greater than condition for the current field.
4848

4949
**Signature**
5050
```
51-
FieldsMatch greaterThan(Object value)
51+
MatchFields greaterThan(Object value)
5252
```
5353

5454
## greaterThanOrEquals (alias geq)
@@ -57,7 +57,7 @@ Defines a greater than or equals condition for the current field.
5757

5858
**Signature**
5959
```
60-
FieldsMatch greaterThanOrEquals(Object value)
60+
MatchFields greaterThanOrEquals(Object value)
6161
```
6262

6363
## hasValue
@@ -66,7 +66,7 @@ Defines a non-null condition for the current field.
6666

6767
**Signature**
6868
```
69-
FieldsMatch hasValue()
69+
MatchFields hasValue()
7070
```
7171

7272
## isIn
@@ -75,12 +75,12 @@ Defines a set membership condition for the current field. `value` has to be a `S
7575

7676
**Signature**
7777
```
78-
FieldsMatch isIn(Object value)
78+
MatchFields isIn(Object value)
7979
```
8080

8181
## isNotIn (alias `ntIn)
8282

8383
**Signature**
8484
```
85-
FieldsMatch isNotIn(Object value)
85+
MatchFields isNotIn(Object value)
8686
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# MatchFields
2+
3+
`MatchFields` implements [`SObjectPredicate`](SObjectPredicate) and returns `true` if a record satisfies all field matching conditions currently defined. `MatchFields` is constructed from an [`IncompleteMatchFields`](IncompleteMatchFields) with a fluent interface.
4+
5+
Additional conditions can be defined with `also`, or its alias `field`, to create complex matching functions.
6+
7+
## also (alias field)
8+
9+
Adds another field condition to the chain.
10+
11+
**Signature**
12+
13+
```
14+
IncompleteMatchFields also(Schema.SObjectField field)
15+
IncompleteMatchFields also(String fieldPath)
16+
```
17+
18+
**Example**
19+
20+
```
21+
MatchFields m = Match.field(Account.Name).equals('Foo').also(Account.AnnualRevenue).greaterThan(100000);
22+
```

website/docs/api/function/RecordFieldsMatch.md renamed to website/docs/api/function/MatchRecordFields.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# RecordFieldsMatch
1+
# MatchRecordFields
22

33
Implements [`SObjectPredicate`](SObjectPredicate).
44

5-
## RecordFieldsMatch
5+
## MatchRecordFields
66

7-
Constructs a `RecordFieldsMatch` for a given `prototype`.
7+
Constructs a `MatchRecordFields` for a given `prototype`.
88

99
**Signature**
1010
```
11-
public RecordFieldsMatch(sObject prototype)
11+
public MatchRecordFields(sObject prototype)
1212
```
1313

1414
## call
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ModifySObject
2+
3+
Implements [`SObjectFunction`](SObjectFunction), and modifies the record it is applied to. Field values can be defined through a fluent interface. It is meant to be used in `forEach` of [`SObjectCollection`](../collection/SObjectCollection) and [`SObjectStream`](../stream/SObjectStream).
4+
5+
## setField
6+
7+
Defines the value of a field.
8+
9+
**Signature**
10+
```
11+
ModifySObject setField(String targetFieldName, Object value)
12+
ModifySObject setField(Schema.SObjectField field, Object value)
13+
```
14+
15+
## setFields
16+
17+
Defines the value of multiple fields.
18+
19+
**Signature**
20+
```
21+
ModifySObject setFields(Map<Schema.SObjectField, Object> fieldValues)
22+
ModifySObject setFields(SObject prototype)
23+
```
24+
25+
## call
26+
27+
Assigns the defined values to `record`.
28+
29+
**Signature**
30+
```
31+
void call(SObject record)
32+
```

0 commit comments

Comments
 (0)