@@ -6,46 +6,52 @@ sidebar_position: 3
66
77Specify 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
121127Specify 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
144173Specify 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
0 commit comments