Skip to content

Instantly share code, notes, and snippets.

@jerryOkafor
Last active October 29, 2016 07:02
Show Gist options
  • Save jerryOkafor/6dbbbb176c87a7cbd24864b27273617a to your computer and use it in GitHub Desktop.
Save jerryOkafor/6dbbbb176c87a7cbd24864b27273617a to your computer and use it in GitHub Desktop.
public class FirebaseQuery {
//Build a key value Pair
public Map<String, Object> getKeyValuePair(){
Object obj = new Object();
Map<String, Object> keyValuePair = new HashMap<>();
keyValuePair.put("key1","This is a string value"); //a string value
keyValuePair.put("key2",12); //an integer value
keyValuePair.put("key3",12.45); //a double value
keyValuePair.put("key4",1233455674); // a long value
keyValuePair.put("key5",obj); //an object value
/*
* Firebase Database supports a range of data types which you can
* see above and you can easily use maps to build a key value pair for string in firebase
* database or updating child nodes
* */
return keyValuePair;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment