List of usage examples for com.google.common.collect ClassToInstanceMap merge
default V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction)
From source file:com.opengamma.strata.basics.market.ImmutableTypedReferenceData.java
@Override public TypedReferenceData combinedWith(TypedReferenceData other) { ClassToInstanceMap<Object> combined = MutableClassToInstanceMap.create(); combined.putAll(values);/*from www . ja v a 2 s. c o m*/ for (Class<?> type : other.types()) { combined.merge(type, other.getValue(type), (v1, v2) -> { if (v1.equals(v2)) { return v1; } throw new IllegalArgumentException(Messages.format( "Unable to combine reference data, values differ for type '{}'", type.getSimpleName())); }); } return ImmutableTypedReferenceData.of(combined); }