Add "fflib_" prefix to primitive domain classes

This commit is contained in:
wim
2021-10-11 13:52:55 +01:00
parent d8e7872c2b
commit 4b58dbb2d1
29 changed files with 172 additions and 171 deletions
@@ -536,35 +536,35 @@ public virtual with sharing class fflib_Criteria
// Method overrides
public fflib_Criteria inSet(Schema.SObjectField field, Set<Date> values)
{
return inSet(field, new Dates(values));
return inSet(field, new fflib_Dates(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<Datetime> values)
{
return inSet(field, new DateTimes(values));
return inSet(field, new fflib_DateTimes(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<Decimal> values)
{
return inSet(field, new Decimals(values));
return inSet(field, new fflib_Decimals(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<Double> values)
{
return inSet(field, new Doubles(values));
return inSet(field, new fflib_Doubles(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<Id> values)
{
return inSet(field, new Ids(values));
return inSet(field, new fflib_Ids(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<Integer> values)
{
return inSet(field, new Integers(values));
return inSet(field, new fflib_Integers(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<Long> values)
{
return inSet(field, new Longs(values));
return inSet(field, new fflib_Longs(values));
}
public fflib_Criteria inSet(Schema.SObjectField field, Set<String> values)
{
return inSet(field, new Strings(values));
return inSet(field, new fflib_Strings(values));
}
/**
* checks if the given sets contains the fields values
@@ -604,35 +604,35 @@ public virtual with sharing class fflib_Criteria
*/
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Date> values)
{
return notInSet(field, new Dates(values));
return notInSet(field, new fflib_Dates(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Datetime> values)
{
return notInSet(field, new DateTimes(values));
return notInSet(field, new fflib_DateTimes(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Decimal> values)
{
return notInSet(field, new Decimals(values));
return notInSet(field, new fflib_Decimals(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Double> values)
{
return notInSet(field, new Doubles(values));
return notInSet(field, new fflib_Doubles(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Id> values)
{
return notInSet(field, new Ids(values));
return notInSet(field, new fflib_Ids(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Integer> values)
{
return notInSet(field, new Integers(values));
return notInSet(field, new fflib_Integers(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Long> values)
{
return notInSet(field, new Longs(values));
return notInSet(field, new fflib_Longs(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<String> values)
{
return notInSet(field, new Strings(values));
return notInSet(field, new fflib_Strings(values));
}
public fflib_Criteria notInSet(Schema.SObjectField field, Set<Object> values)
{
@@ -1,5 +1,5 @@
/**
* File Name: DateTimes
* File Name: fflib_DateTimes
* @description Primitive domain for the object type DateTime
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class DateTimes
extends Objects
public virtual with sharing class fflib_DateTimes
extends fflib_Objects2
{
public DateTimes(Set<Datetime> dateTimes)
public fflib_DateTimes(Set<Datetime> dateTimes)
{
super(new List<Datetime>(dateTimes));
}
public DateTimes(List<Datetime> dateTimes)
public fflib_DateTimes(List<Datetime> dateTimes)
{
super((List<Object>) dateTimes);
}
public DateTimes(List<Object> elements)
public fflib_DateTimes(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: Dates
* File Name: fflib_Dates
* @description Primitive domain for the object type Date
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual class Dates
extends Objects
public virtual class fflib_Dates
extends fflib_Objects2
{
public Dates(Set<Date> dates)
public fflib_Dates(Set<Date> dates)
{
super(new List<Date>(dates));
}
public Dates(List<Date> dates)
public fflib_Dates(List<Date> dates)
{
super((List<Object>) dates);
}
public Dates(List<Object> elements)
public fflib_Dates(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: Decimals
* File Name: fflib_Decimals
* @description Primitive domain for the object type Decimal
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Decimals
extends Objects
public virtual with sharing class fflib_Decimals
extends fflib_Objects2
{
public Decimals(Set<Decimal> decimals)
public fflib_Decimals(Set<Decimal> decimals)
{
super(new List<Decimal>(decimals));
}
public Decimals(List<Decimal> decimals)
public fflib_Decimals(List<Decimal> decimals)
{
super((List<Object>) decimals);
}
public Decimals(List<Object> elements)
public fflib_Decimals(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: Doubles
* File Name: fflib_Doubles
* @description Primitive domain for the object type Double
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Doubles
extends Objects
public virtual with sharing class fflib_Doubles
extends fflib_Objects2
{
public Doubles(Set<Double> doubles)
public fflib_Doubles(Set<Double> doubles)
{
super(new List<Double>(doubles));
}
public Doubles(List<Double> doubles)
public fflib_Doubles(List<Double> doubles)
{
super((List<Object>) doubles);
}
public Doubles(List<Object> elements)
public fflib_Doubles(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: Ids
* File Name: fflib_Ids
* @description Primitive domain for the object type Id
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,25 +28,25 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Ids
extends Objects
public virtual with sharing class fflib_Ids
extends fflib_Objects2
{
public Ids(Set<Id> idSet)
public fflib_Ids(Set<Id> idSet)
{
super(new List<Id>(idSet));
}
public Ids(List<Id> ids)
public fflib_Ids(List<Id> ids)
{
super((List<Object>) ids);
}
public Ids(List<Object> elements)
public fflib_Ids(List<Object> elements)
{
super(elements);
}
public Ids(fflib_Objects objects)
public fflib_Ids(fflib_Objects objects)
{
super(getIdList(objects));
}
@@ -1,5 +1,5 @@
/**
* File Name: Integers
* File Name: fflib_Integers
* @description Primitive domain for the object type Integer
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Integers
extends Objects
public virtual with sharing class fflib_Integers
extends fflib_Objects2
{
public Integers(Set<Integer> integerSet)
public fflib_Integers(Set<Integer> integerSet)
{
super(new List<Integer>(integerSet));
}
public Integers(List<Integer> integerList)
public fflib_Integers(List<Integer> integerList)
{
super((List<Integer>) integerList);
}
public Integers(List<Object> elements)
public fflib_Integers(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: Longs
* File Name: fflib_Longs
* @description Primitive domain for the object type Long
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Longs
extends Objects
public virtual with sharing class fflib_Longs
extends fflib_Objects2
{
public Longs(Set<Long> longs)
public fflib_Longs(Set<Long> longs)
{
super(new List<Long>(longs));
}
public Longs(List<Long> longs)
public fflib_Longs(List<Long> longs)
{
super((List<Object>) longs);
}
public Longs(List<Object> elements)
public fflib_Longs(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: Objects
* File Name: fflib_Objects2
* @description Primitive domain for the type object
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,10 +28,10 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Objects
public virtual with sharing class fflib_Objects2
extends fflib_Objects
{
public Objects(List<Object> elements)
public fflib_Objects2(List<Object> elements)
{
super(elements);
}
@@ -1,5 +1,5 @@
/**
* File Name: SObjects
* File Name: fflib_SObjects2
* @description Primitive domain for the object type SObject
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,7 +28,7 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual class SObjects
public virtual class fflib_SObjects2
extends fflib_SObjects
implements fflib_ISObjects
{
@@ -39,7 +39,7 @@ public virtual class SObjects
*
* @param objects The Objects of type SObjectType, to contain inside the domain
*/
public SObjects(List<Object> objects)
public fflib_SObjects2(List<Object> objects)
{
// todo - assert of objects of type SObject
this((List<SObject>) objects);
@@ -50,7 +50,7 @@ public virtual class SObjects
*
* @param records The records to contain inside the domain
*/
public SObjects(List<SObject> records)
public fflib_SObjects2(List<SObject> records)
{
this(records, records.getSObjectType());
}
@@ -61,7 +61,7 @@ public virtual class SObjects
* @param records The records to contain inside the domain
* @param sObjectType The SObjectType of the records
*/
public SObjects(List<SObject> records, Schema.SObjectType sObjectType)
public fflib_SObjects2(List<SObject> records, Schema.SObjectType sObjectType)
{
super(records, sObjectType);
SObjectDescribe = sObjectType.getDescribe();
@@ -92,7 +92,7 @@ public virtual class SObjects
*
* @return Returns only the SObjects from the domain matching the given Ids.
*/
public virtual List<SObject> getRecords(Ids ids)
public virtual List<SObject> getRecords(fflib_Ids ids)
{
return getRecords(ids.getIds());
}
@@ -193,7 +193,7 @@ public virtual class SObjects
* @return The Date values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Dates getDateFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Dates getDateFieldValues(Schema.SObjectField sObjectField)
{
Set<Date> result = new Set<Date>();
for (SObject record : getRecords())
@@ -202,7 +202,7 @@ public virtual class SObjects
if (fieldValue == null) continue;
result.add((Date) fieldValue);
}
return new Dates(result);
return new fflib_Dates(result);
}
/**
@@ -212,9 +212,9 @@ public virtual class SObjects
* @return The Date values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Dates getDateFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Dates getDateFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getDateFieldValues(sObjectField);
}
@@ -224,7 +224,7 @@ public virtual class SObjects
* @return The DateTime values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual DateTimes getDateTimeFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_DateTimes getDateTimeFieldValues(Schema.SObjectField sObjectField)
{
Set<Datetime> result = new Set<Datetime>();
for (SObject record : getRecords())
@@ -233,7 +233,7 @@ public virtual class SObjects
if (fieldValue == null) continue;
result.add((Datetime) fieldValue);
}
return new DateTimes(result);
return new fflib_DateTimes(result);
}
/**
@@ -243,9 +243,9 @@ public virtual class SObjects
* @return The DateTime values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual DateTimes getDateTimeFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_DateTimes getDateTimeFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getDateTimeFieldValues(sObjectField);
}
@@ -255,7 +255,7 @@ public virtual class SObjects
* @return The Decimal values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Decimals getDecimalFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Decimals getDecimalFieldValues(Schema.SObjectField sObjectField)
{
Set<Decimal> result = new Set<Decimal>();
for (SObject record : getRecords())
@@ -264,7 +264,7 @@ public virtual class SObjects
if (fieldValue == null) continue;
result.add((Decimal) fieldValue);
}
return new Decimals(result);
return new fflib_Decimals(result);
}
/**
@@ -274,9 +274,9 @@ public virtual class SObjects
* @return The Decimal values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Decimals getDecimalFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Decimals getDecimalFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getDecimalFieldValues(sObjectField);
}
@@ -286,7 +286,7 @@ public virtual class SObjects
* @return The Double values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Doubles getDoubleFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Doubles getDoubleFieldValues(Schema.SObjectField sObjectField)
{
Set<Double> result = new Set<Double>();
for (SObject record : getRecords())
@@ -295,7 +295,7 @@ public virtual class SObjects
if (fieldValue == null) continue;
result.add((Double) fieldValue);
}
return new Doubles(result);
return new fflib_Doubles(result);
}
/**
@@ -305,9 +305,9 @@ public virtual class SObjects
* @return The Double values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Doubles getDoubleFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Doubles getDoubleFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getDoubleFieldValues(sObjectField);
}
@@ -440,7 +440,7 @@ public virtual class SObjects
* @return The Id values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Ids getIdFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Ids getIdFieldValues(Schema.SObjectField sObjectField)
{
Set<Id> result = new Set<Id>();
for (SObject record : getRecords())
@@ -450,7 +450,7 @@ public virtual class SObjects
result.add(Id.valueOf(String.valueOf(fieldValue)));
}
return new Ids(result);
return new fflib_Ids(result);
// todo - alternative return to avoid code duplications: return new Ids(getFieldValues(sObjectField));
}
@@ -461,9 +461,9 @@ public virtual class SObjects
* @return The Id values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Ids getIdFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Ids getIdFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getIdFieldValues(sObjectField);
}
@@ -473,7 +473,7 @@ public virtual class SObjects
* @return The Integer values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Integers getIntegerFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Integers getIntegerFieldValues(Schema.SObjectField sObjectField)
{
Set<Integer> result = new Set<Integer>();
for (SObject record : getRecords())
@@ -483,7 +483,7 @@ public virtual class SObjects
result.add(Integer.valueOf(fieldValue));
}
return new Integers(result);
return new fflib_Integers(result);
}
/**
@@ -493,9 +493,9 @@ public virtual class SObjects
* @return The Integer values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Integers getIntegerFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Integers getIntegerFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getIntegerFieldValues(sObjectField);
}
@@ -505,7 +505,7 @@ public virtual class SObjects
* @return The Long values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Longs getLongFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Longs getLongFieldValues(Schema.SObjectField sObjectField)
{
Set<Long> result = new Set<Long>();
for (SObject record : getRecords())
@@ -514,7 +514,7 @@ public virtual class SObjects
if (fieldValue == null) continue;
result.add((Long) fieldValue);
}
return new Longs(result);
return new fflib_Longs(result);
}
/**
@@ -524,9 +524,9 @@ public virtual class SObjects
* @return The Long values of the given sObjectField, null values are omitted
*/
@TestVisible
protected virtual Longs getLongFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Longs getLongFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getLongFieldValues(sObjectField);
}
@@ -699,14 +699,14 @@ public virtual class SObjects
* @return The String values of the given sObjectField
*/
@TestVisible
protected virtual Strings getStringFieldValues(Schema.SObjectField sObjectField)
protected virtual fflib_Strings getStringFieldValues(Schema.SObjectField sObjectField)
{
Set<String> result = new Set<String>();
for (SObject record : getRecords())
{
result.add(String.valueOf(record.get(sObjectField)));
}
return new Strings(result);
return new fflib_Strings(result);
}
/**
@@ -716,9 +716,9 @@ public virtual class SObjects
* @return The String values of the given sObjectField
*/
@TestVisible
protected virtual Strings getStringFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
protected virtual fflib_Strings getStringFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)
{
return new SObjects(getRecords(criteria), getSObjectType())
return new fflib_SObjects2(getRecords(criteria), getSObjectType())
.getStringFieldValues(sObjectField);
}
@@ -732,7 +732,7 @@ public virtual class SObjects
@TestVisible
protected virtual void setFieldValue(Schema.SObjectField sObjectField, Object value, fflib_Criteria criteria)
{
new SObjects(getRecords(criteria), getSObjectType())
new fflib_SObjects2(getRecords(criteria), getSObjectType())
.setFieldValue(sObjectField, value);
}
}
@@ -1,5 +1,5 @@
/**
* File Name: Strings
* File Name: fflib_Strings
* @description Primitive domain for the object type String
*
* @author architect ir. Wilhelmus G.J. Velzeboer
@@ -28,20 +28,20 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public virtual with sharing class Strings
extends Objects
public virtual with sharing class fflib_Strings
extends fflib_Objects2
{
public Strings(Set<String> stringSet)
public fflib_Strings(Set<String> stringSet)
{
super(new List<String>(stringSet));
}
public Strings(List<String> stringList)
public fflib_Strings(List<String> stringList)
{
super(stringList);
}
public Strings(List<Object> elements)
public fflib_Strings(List<Object> elements)
{
super(elements);