diff --git a/src/main/java/org/ntlab/nemophila/entities/ShopJson.java b/src/main/java/org/ntlab/nemophila/entities/ShopJson.java new file mode 100644 index 0000000..0b58174 --- /dev/null +++ b/src/main/java/org/ntlab/nemophila/entities/ShopJson.java @@ -0,0 +1,70 @@ +package org.ntlab.nemophila.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.ntlab.nemophila.models.shops.Shop; + +import java.util.HashSet; + +public class ShopJson { + @JsonProperty("sid") + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("longitude") + private double longitude; + @JsonProperty("latitude") + private double latitude; + @JsonProperty("genreSet") + private HashSet genreSets; + @JsonProperty("userIdSet") + private HashSet userIdSets; + + //Getter + public String getId() { + return id; + } + public String getName() { + return name; + } + public double getLongitude() { + return longitude; + } + public double getLatitude() { + return latitude; + } + public HashSet getGenreSets() { + return genreSets; + } + public HashSet getUserIdSets() { + return userIdSets; + } + + //Setter + public void setId(String id) { + this.id = id; + } + public void setName(String name) { + this.name = name; + } + public void setLongitude(double longitude) { + this.longitude = longitude; + } + public void setLatitude(double latitude) { + this.latitude = latitude; + } + public void setGenreSets(HashSet genreSets) { + this.genreSets = genreSets; + } + public void setUserIdSets(HashSet userIdSets) { + this.userIdSets = userIdSets; + } + + public ShopJson(Shop shop, HashSet genreSets, HashSet userIdSets) { + this.setId(shop.getId()); + this.setName(shop.getName()); + this.setLongitude(shop.getLongitude()); + this.setLatitude(shop.getLatitude()); + this.setGenreSets(genreSets); + this.setUserIdSets(userIdSets); + } +}