Skip to content

Instantly share code, notes, and snippets.

@VaidotasK
Created July 14, 2018 12:48
Show Gist options
  • Save VaidotasK/ba6e676fd6e9102b70b52d94a7ce40e0 to your computer and use it in GitHub Desktop.
Save VaidotasK/ba6e676fd6e9102b70b52d94a7ce40e0 to your computer and use it in GitHub Desktop.
Custom class Place
// For pub Fragment
public Place(String name, String address, String price, String description) {
this.name = name;
this.address = address;
this.price = price;
this.description = description;
}
public Place(String name, int placeImageResourceId, String address, String price, String description) {
this.name = name;
this.placeImageResourceId = placeImageResourceId;
this.address = address;
this.price = price;
this.description = description;
}
public String getPlaceName() {
return name;
}
public int getPlaceImageResourceId() {
return placeImageResourceId;
}
public String getPlaceDescription() {
return description;
}
public String getPlacePrice() {
return price;
}
public String getPlaceAddress() {
return address;
}
public boolean hasImage() {
return placeImageResourceId != NO_IMAGE;
}
public boolean hasDescription() {
return description != NO_DESCRIPTION;
}
public boolean hasPlacePrice() {
return price != NO_PRICE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment