Skip to content

Releases: ipavlic/apex-fp

Black Tuesday

20 Nov 19:30
Compare
Choose a tag to compare

Adds Transform to support prototype-matching definition of SObjectToSobject functions. Put simply,

Opportunity prototype = new Opportunity(Name = 'Test')
Collection.of(opps).mapAll(Transform.record(prototype));

will copy all defined field values on the provided prototype to records in collection, overwriting any existing values for those fields. Other fields will not be touched.

Remembrance Poppy

11 Nov 04:22
Compare
Choose a tag to compare

Implements the general programme described in #4. Collection class has been introduced as a view of underlying Apex collections which provides functional methods.

For simpler cases, the change brings more verbosity, for example:

Pluck.strings(Account.Name, accounts);
Collection.of(accounts).pluckStrings(Account.Name);

However, for more complex cases, the readability is improved, and the library is more flexible. Compare previously required nesting with chaining:

Pluck.strings(..., MapAll.records(..., Filter.field(...)));
Collection.of(accounts).filter(...).mapAll(...).pluckStrings(...);

The number of classes was reduced, and behaviour generally harmonized across different functionalities. Since the API was completely changed, a migration is required, which should be straightforward in most cases.

2.0.0

11 May 14:57
Compare
Choose a tag to compare

Parameter ordering was changed to make chaining more readable. Compare:

GroupBy.dates(Opportunity.CloseDate, Filter.field...);

with previous:

GroupBy.dates(Filter.field..., Opportunity.CloseDate);

1.0.0

13 Feb 05:16
Compare
Choose a tag to compare

Filtering related classes were renamed to make their purpose clearer.

Filter fields can now also be defined through String parameters, and the field names can be provided as relations (e.g. Account.Name is a valid field relation on Opportunity record that has Account relationship selected). This builds on top of similar functionality previously provided for Pluck.

0.3.0

09 Feb 04:22
Compare
Choose a tag to compare

Pluck now supports relations through String parameters. This capability is supported by RelationFieldReader.

0.2.0

11 May 15:15
Compare
Choose a tag to compare
fix examples

0.1.0

11 May 15:15
Compare
Choose a tag to compare
fix examples