- Name: Pradyun S. Gedam
- Email: [[email protected]][mailto-email]
- Github: [pradyunsg][github-profile]
- University: [VIT University, Vellore, India][vit-homepage]
- Course: Bachelor of Technology in Computer Science and Engineering
- Course Term: 2016/17 - 2019/20 (4 Year)
- Timezone: IST (GMT +5:30)
- GSoC Blog RSS Feed URL:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseDataSnapshotMapper { | |
public static void map(Object object, DataSnapshot dataSnapshot) { | |
try { | |
final Class<?> aClass = object.getClass(); | |
final Field[] fields = aClass.getDeclaredFields(); | |
for (final Field classField : fields) { | |
if (classField.isAnnotationPresent(Firemapped.class)) { | |
classField.setAccessible(true); | |
final Firemapped annotation = classField.getAnnotation(Firemapped.class); | |
final DataSnapshot child = dataSnapshot.child(annotation.firebasePath()); |