R.apex

  • Docs
  • Tutorials
Docs Menu
  • Func
  • R.Funcs
    • Conversion Funcs
    • Arithmetic Funcs
    • Logic Funcs
    • Relation Funcs
    • Function Funcs
    • Comparator Funcs
    • Condition Funcs
    • List Funcs
    • String Funcs
    • Map Funcs
    • Utility Funcs
    • Database Funcs
  • R.Instance
    • Creation Methods
    • Conversion Methods
    • Methods

Map Funcs Guide

Map Funcs in R

doMerge

Merge the two objects.

R.doMerge.run(R.withObj('name', 'b'), R.withObj('name', 'a'))
// {name=b}

has

Check if the wrapped object has a non-null value of the field.

R.has.run('Description', new Account())
// false

invert

Invert the wrapped object, with values mapped by the same key added to a list.

R.invert.run(R.withObj('name', 'test'))
// {name=test}

invertObj

Invert the wrapped object.

R.invertObj.run(R.withObj('name', 'test'))
// {name=test}

keys

Get the keys.

R.keys.run(R.withObj('name', 'test'))
// {name}

omit

Omit the fields and pick remaining fields into a map.

R.omit.run(R.with('Description'), new Account(Description='desc', FirstName='name'))
// {FirstName=name}

pick

Pick the fields into a map.

R.pick.run(R.with('Description'), new Account(Description='desc', FirstName='name'))
// {Description=desc}

prop

Get the property value.

R.prop.run('Description', new Account(Description='desc'))
// desc

propEq

Check that its property value equals given value.

R.propEq.run('Description', 'desc', new Account(Description='desc'))
// true

propOr

Get the property value, or return the default value if it is null.

R.propOr.run('Description', 'desc', new Account())
// desc

propSObject

Get the property value by 'getSObject'.

propSObjects

Get the property value by 'getSObjects'.

propSatisfies

Check if the property value satisfies the predicate.

R.propSatisfies.run('Description', R.isNotNull, new Account())
// false

values

Get the values.

R.values.run(R.withObj('name', 'test'))
// (test)

whereEq

Check if matching the key-values.

R.whereEq.run(R.withObj('Description', 'desc'), new Account(Description='desc'))
// true

whereSatisfies

Check if matching the key-predicates.

R.whereSatisfies.run(R.withObj('Description', R.isNotNull), new Account(Description='desc'))
// true

path

Get the property value according to the field path, separated by '.'.

R.path.run('Owner.Id', acc)
// desc

Contribute on Github! Edit this section.