Skip to content

Instantly share code, notes, and snippets.

@mogeta

mogeta/FoodMenu.java

Last active Sep 15, 2016
Embed
What would you like to do?
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