ascend
Convert a function into an ascending comparator.
Func f = (Func)R.ascend.run(R.identity);
System.debug(f.run(1, 2));
// -1
Convert a function into an ascending comparator.
Func f = (Func)R.ascend.run(R.identity);
System.debug(f.run(1, 2));
// -1
Combine the comparator functions into one.
Func f = (Func)R.cascade.run(
(Func)R.ascend.run(R.prop.apply('FirstName')),
(Func)R.ascend.run(R.prop.apply('Description'))
);
Limit the value between the min and the max.
R.clamp.run(1, 3, 5)
// 3
Convert a Boolean-returning comparator to an Integer-returning comparator.
Func f = (Func)R.comparator.run(R.lt);
System.debug(f.run(1, 2));
// -1
Compare two objects.
R.compare.run(1, 2)
// -1
Convert a function into an descending comparator.
Func f = (Func)R.descend.run(R.identity);
System.debug(f.run(1, 2));
// 1
Contribute on Github! Edit this section.