Skip to content

Instantly share code, notes, and snippets.

@mogeta
Last active September 15, 2016 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogeta/c4c1ec6e3e7efc1accc8fced8c10c2f7 to your computer and use it in GitHub Desktop.
Save mogeta/c4c1ec6e3e7efc1accc8fced8c10c2f7 to your computer and use it in GitHub Desktop.
firebase dto
public class FoodMenu {
private String title;
private String detail;
private int price;
private String photoURL;
public FoodMenu(){
}
public FoodMenu(String title, String detail, int price, String photoURL) {
this.title = title;
this.detail = detail;
this.price = price;
this.photoURL = photoURL;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getPhotoURL() {
return photoURL;
}
public void setPhotoURL(String photoURL) {
this.photoURL = photoURL;
}
}
private DatabaseReference mFirebaseDatabaseReference;
private void Add(Uri uri){
FoodMenu foodMenu = new FoodMenu("title","detail",800,uri.toString());
mFirebaseDatabaseReference.child(MESSAGES_CHILD)
.push().setValue(foodMenu);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment