use of facebook4j.Reading in project camel by apache.
the class ReadingBuilder method merge.
public static Reading merge(Reading reading, Reading readingUpdate) throws NoSuchFieldException, IllegalAccessException {
Reading mergedReading = new Reading();
Field field = Reading.class.getDeclaredField("parameterMap");
field.setAccessible(true);
final LinkedHashMap<String, Object> readingParameters = (LinkedHashMap<String, Object>) field.get(reading);
readingParameters.putAll((LinkedHashMap<String, Object>) field.get(readingUpdate));
field.setAccessible(false);
setProperties(mergedReading, readingParameters);
return mergedReading;
}
Aggregations