Search in sources :

Example 6 with Reading

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;
}
Also used : Field(java.lang.reflect.Field) Reading(facebook4j.Reading) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

Reading (facebook4j.Reading)6 Date (java.util.Date)3 HashMap (java.util.HashMap)3 Field (java.lang.reflect.Field)2 SimpleDateFormat (java.text.SimpleDateFormat)2 LinkedHashMap (java.util.LinkedHashMap)2 Test (org.junit.Test)2 Map (java.util.Map)1