Foundations Apex API Developer Reference

fferpcore.TargetObjectMap

global interface TargetObjectMap extends TargetObjectCollection

This class represents a Map of Target Objects keyed on an arbitrary key.
The key will most often relate to the Correlation ID used in messages concerning this Target Object. This allows Target Objects to be found for update based on a Message. Data Targets that support correlation are expected to persist the keys and return Target Objects using the same keys in future queries.
A surrogate key can be used in scenarios that do not need a correlation ID. An example is a scenario that only inserts data, never updates it. A Data Target that uses surrogate key will not be expected to persist the key or to return Target Objects using the same keys in response to future queries.

This class extends fferpcore.TargetObjectCollection

Methods

keySet

Set<Object> keySet()

Return Value

The set of keys in the map. This key set can include the keys of items that are pending destroy if the destruction has not yet happened. This key set is not guaranteed to be connected to the Map. Deletion from this keyset may not reflect in the map.

values

List<TargetObject> values()

Return Value

List of Target Objects in the map. This should not return destroyed targets.

get

TargetObject get(Object key)

Return Value

The Target Object with the given key, or null if the key is not present. This should not return destroyed targets.

create

TargetObject create(Object key)

Create a Target Object with the given key. If the target was previously destroyed then it must either be replaced with a new one, or its state set to simulate the creation of a new Target Object. Changes to the destroyed Target Object including previously persisted changes must be lost. This allows replace semantics to work correctly.

© Copyright 2009–2023 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.