Skip to content

Commit 3da1e4b

Browse files
authored
API Documentation update (#70)
1 parent 527d0e2 commit 3da1e4b

File tree

6 files changed

+403
-274
lines changed

6 files changed

+403
-274
lines changed

website/docs/api/soql-filter.md

Lines changed: 75 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,52 @@ sidebar_position: 3
66

77
Specify and adjust single condition.
88

9-
```apex
10-
public interface Filter { // SOQL.Filter
11-
Filter id();
12-
Filter recordType();
13-
Filter name();
14-
Filter with(SObjectField field);
15-
Filter with(String field);
16-
Filter with(String relationshipName, SObjectField field);
17-
18-
Filter isNull(); // = NULL
19-
Filter isNotNull(); // != NULL
20-
Filter isTrue(); // = TRUE
21-
Filter isFalse(); // = FALSE
22-
Filter equal(Object value); // = :value
23-
Filter notEqual(Object value); // != :value
24-
Filter lessThan(Object value); // < :value
25-
Filter greaterThan(Object value); // > :value
26-
Filter lessOrEqual(Object value); // <= :value
27-
Filter greaterOrEqual(Object value); // >= :value
28-
Filter containsSome(List<String> values); // LIKE :values
29-
Filter contains(String value); // LIKE :'%' + value + '%'
30-
Filter endsWith(String value); // LIKE :'%' + value
31-
Filter startsWith(String value); // LIKE :value + '%'
32-
Filter contains(String prefix, String value, String suffix); // custom LIKE
33-
Filter isIn(Iterable<Object> iterable); // IN :inList or inSet
34-
Filter isIn(List<Object> inList); // IN :inList
35-
Filter isIn(InnerJoin joinQuery); // SOQL.InnerJoin
36-
Filter notIn(Iterable<Object> iterable); // NOT IN :inList or inSet
37-
Filter notIn(List<Object> inList); // NOT IN :inList
38-
Filter notIn(InnerJoin joinQuery); // SOQL.InnerJoin
39-
Filter includesAll(Iterable<String> values); // join with ;
40-
Filter includesSome(Iterable<String> values); // join with ,
41-
Filter excludesAll(Iterable<String> values); // join with ,
42-
Filter excludesSome(Iterable<String> values); // join with ;
43-
44-
Filter ignoreWhen(Boolean logicExpression); // Condition will be removed when logicExpression evaluates to true
45-
}
46-
```
47-
48-
## predefinied
9+
## Methods
10+
11+
The following are methods for `Filter`.
12+
13+
[**FIELDS**](#fields)
14+
15+
- [`id()`](#id)
16+
- [`recordType()`](#recordtype)
17+
- [`name()`](#name)
18+
- [`with(SObjectField field)`](#with-sobject-field)
19+
- [`with(String field)`](#with-string-field)
20+
- [`with(String relationshipName, SObjectField field)`](#with-related-field)
21+
22+
[**COMPERATORS**](#comperators)
23+
24+
- [`isNull()`](#isnull)
25+
- [`isNotNull()`](#isnotnull)
26+
- [`isTrue()`](#istrue)
27+
- [`isFalse()`](#isfalse)
28+
- [`equal(Object value)`](#equal)
29+
- [`notEqual(Object value)`](#notequal)
30+
- [`lessThan(Object value)`](#lessthan)
31+
- [`greaterThan(Object value)`](#greaterthan)
32+
- [`lessOrEqual(Object value)`](#lessorequal)
33+
- [`greaterOrEqual(Object value)`](#greaterorequal)
34+
- [`containsSome(List<String> values)`](#containssome)
35+
- [`contains(String value)`](#contains)
36+
- [`endsWith(String value)`](#endswith)
37+
- [`startsWith(String value)`](#startswith)
38+
- [`contains(String prefix, String value, String suffix)`](#contains)
39+
- [`isIn(Iterable<Object> iterable)`](#isin)
40+
- [`isIn(List<Object> inList)`](#isin)
41+
- [`isIn(InnerJoin joinQuery)`](#isin-join-query)
42+
- [`notIn(Iterable<Object> iterable)`](#notin)
43+
- [`notIn(List<Object> inList)`](#notin)
44+
- [`notIn(InnerJoin joinQuery)`](#notin-join-query)
45+
- [`includesAll(Iterable<String> values)`](#includesall)
46+
- [`includesSome(Iterable<String> values)`](#includessome)
47+
- [`excludesAll(Iterable<String> values)`](#excludesall)
48+
- [`excludesSome(Iterable<String> values)`](#excludessome)
49+
50+
[**ADDITIONAL**](#additional)
51+
52+
- [`ignoreWhen(Boolean logicExpression)`](#ignorewhen)
53+
54+
## FIELDS
4955
### id
5056

5157
- `WHERE Id = :accountId`
@@ -115,8 +121,8 @@ SOQL.of(Account.SObjectType)
115121
.whereAre(SOQL.Filter.name().equal('My Account'))
116122
.toList();
117123
```
118-
## fields
119-
### with field
124+
125+
### with sobject field
120126

121127
Specify field that should be used in the condition.
122128

@@ -139,6 +145,29 @@ SOQL.of(Account.SObjectType)
139145
.toList();
140146
```
141147

148+
### with string field
149+
150+
Specify fields that should be used in the condition.
151+
152+
**Signature**
153+
154+
```apex
155+
Filter with(String field)
156+
```
157+
158+
**Example**
159+
160+
```sql
161+
SELECT Id
162+
FROM Account
163+
WHERE Name = 'My Account'
164+
```
165+
```apex
166+
SOQL.of(Account.SObjectType)
167+
.whereAre(SOQL.Filter.with('Name').equal('My Account'))
168+
.toList();
169+
```
170+
142171
### with related field
143172

144173
Specify parent field that should be used in the condition.
@@ -162,7 +191,7 @@ SOQL.of(Contact.SObjectType)
162191
.toList();
163192
```
164193

165-
## comperators
194+
## COMPERATORS
166195

167196
### isNull
168197

@@ -565,8 +594,7 @@ SOQL.of(Contact.SObjectType)
565594
```
566595

567596
## join query
568-
569-
### isIn
597+
### isIn join query
570598

571599
- `WHERE Id IN (SELECT AccountId FROM Contact WHERE Name = 'My Contact')`
572600

@@ -596,7 +624,7 @@ SOQL.of(Account.SObjectType)
596624
)).toList();
597625
```
598626

599-
### notIn
627+
### notIn join query
600628

601629
- `WHERE Id NOT IN (SELECT AccountId FROM Contact WHERE Name = 'My Contact')`
602630

@@ -732,7 +760,7 @@ SOQL builder = SOQL.of(AccountContactRelation.SObjectType)
732760
.whereAre(SOQL.Filter.with(AccountContactRelation.Roles).excludesSome(roles));
733761
```
734762

735-
## additional
763+
## ADDITIONAL
736764

737765
### ignoreWhen
738766

website/docs/api/soql-filters-group.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@ sidebar_position: 4
66

77
Create group of conditions.
88

9-
```apex
10-
public interface FilterGroup { // SOQL.FilterGroup
11-
FilterGroup add(FilterGroup filterGroup); // SOQL.FilterGroup
12-
FilterGroup add(Filter filter); // SOQL.Filter
13-
FilterGroup add(String dynamicCondition); // Pass condition as String
14-
15-
FilterGroup anyConditionMatching(); // All group filters will be join by OR
16-
FilterGroup conditionLogic(String order);
17-
}
18-
```
9+
## Methods
10+
11+
The following are methods for `FilterGroup`.
12+
13+
[**ADD CONDITION**](#add-condition)
14+
15+
- [`add(FilterGroup filterGroup)`](#add)
16+
- [`add(Filter filter)`](#add)
17+
- [`add(String dynamicCondition)`](#add)
18+
19+
[**ORDER**](#order)
20+
21+
- [`anyConditionMatching()`](#anyconditionmatching)
22+
- [`conditionLogic(String order)`](#conditionlogic)
1923

20-
## add
24+
## ADD CONDITION
25+
### add
2126

2227
Allows to add multiple conditions.
2328
Add a [`SOQL.Filter`](soql-filter.md) or [`SOQL.FilterGroup`](soql-filters-group.md) or `String`.
@@ -72,7 +77,8 @@ SOQL.of(Account.SObjectType)
7277
).toList();
7378
```
7479

75-
## conditionLogic
80+
## ORDER
81+
### conditionLogic
7682

7783
Set conditions order for SOQL query.
7884
When not specify all conditions will be with `AND`.
@@ -101,7 +107,7 @@ SOQL.of(Account.SObjectType)
101107
).toList();
102108
```
103109

104-
## anyConditionMatching
110+
### anyConditionMatching
105111

106112
When the [conditionLogic](#anyconditionmatching) is not specified, all conditions are joined using the `AND` operator by default.
107113

website/docs/api/soql-join.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@ sidebar_position: 5
66

77
Construct join-query and use it in condition.
88

9-
```apex
10-
public interface InnerJoin { // SOQL.InnerJoin
11-
InnerJoin of(SObjectType ofObject);
9+
## Methods
1210

13-
InnerJoin with(SObjectField field);
11+
The following are methods for `FilterGroup`.
1412

15-
InnerJoin whereAre(FilterGroup filterGroup); // SOQL.FilterGroup
16-
InnerJoin whereAre(Filter filter); // SOQL.Filter
17-
}
18-
```
13+
[**INIT**](#init)
14+
15+
- [`of(SObjectType ofObject)`](#of)
16+
17+
[**SELECT**](#select)
18+
19+
- [`with(SObjectField field)`](#with)
20+
21+
[**WHERE**](#where)
22+
23+
- [`whereAre(FilterGroup filterGroup)`](#whereare)
24+
- [`whereAre(Filter filter)`](#whereare)
1925

20-
## of
26+
## INIT
27+
### of
2128

2229
Conctructs an `JoinQuery`.
2330

@@ -46,7 +53,8 @@ SOQL.of(Account.SObjectType)
4653
)).toList();
4754
```
4855

49-
## with
56+
## SELECT
57+
### with
5058

5159
> `SELECT` statement that specifies the fields to query.
5260
@@ -74,7 +82,8 @@ SOQL.of(Account.SObjectType)
7482
)).toList();
7583
```
7684

77-
## whereAre
85+
## WHERE
86+
### whereAre
7887

7988
> The condition expression in a `WHERE` clause of a SOQL query includes one or more field expressions. You can specify multiple field expressions in a condition expression by using logical operators.
8089

0 commit comments

Comments
 (0)