integrate static method

Map<String, Object> integrate(
  1. Map<String, Object> original,
  2. Iterable<Object> toIntegrate
)

Utility used to augment an existing mapping of type names to objects.

Implementation

static Map<String, Object> integrate(Map<String, Object> original, Iterable<Object> toIntegrate) {
  final revised = Map<String, Object>.of(original);
  for(final sourceModel in toIntegrate) {
    final key = AFModelWithCustomID.stateKeyFor(sourceModel);
    final model = AFModelWithCustomID.modelFor(sourceModel);
    if(model != null) {
      revised[key] = model;
    }
  }
  return revised;
}