diff options
author | Tyler Ferrari <69283684+Sowgro@users.noreply.github.com> | 2025-03-31 20:19:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-31 20:19:44 -0400 |
commit | b7539414ac6aa8efd423a3a9a0a2b5586757e19c (patch) | |
tree | 39a21dc367d3891c53e849f5e1ce81eaebc0fd21 /ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | |
parent | 459c716d5429c040ac25435aab93f896f2fd79c3 (diff) | |
parent | a2e1329a510375fdada021c3d6a2f631a9c162ee (diff) | |
download | JellySolutions-b7539414ac6aa8efd423a3a9a0a2b5586757e19c.tar.gz JellySolutions-b7539414ac6aa8efd423a3a9a0a2b5586757e19c.tar.bz2 JellySolutions-b7539414ac6aa8efd423a3a9a0a2b5586757e19c.zip |
Merge pull request #21 from RIT-SWEN-261-02/need-description
Need description and image support
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java')
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index 55a9441..9b6170b 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -10,6 +10,7 @@ public class Need { } @JsonProperty("name") private String name; + @JsonProperty("image") private String image; @JsonProperty("location") private String location; @JsonProperty("id") private int id; @JsonProperty("filterAttributes") private String[] filterAttributes; @@ -17,6 +18,7 @@ public class Need { @JsonProperty("maxGoal") private double maxGoal; @JsonProperty("urgent") private boolean urgent; @JsonProperty("current") private double current; + @JsonProperty("description") private String description; /** * Create a new need, used by the controller @@ -27,31 +29,38 @@ public class Need { * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) * @param urgent The urgency of the need + * @param description The description of the need */ - public Need(@JsonProperty("name") String name, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type, @JsonProperty("urgent") boolean urgent) { + public Need(@JsonProperty("name") String name, @JsonProperty("image") String image, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type, @JsonProperty("urgent") boolean urgent, @JsonProperty("Description") String description) { this.id = id; + this.image = image; this.location = location; this.name = name; this.maxGoal = maxGoal; this.type = type; this.urgent = urgent; + this.description = description; } /** * Create a new need * * @param name The name of the need + * @param image The image representation of the need * @param location The location of the need * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) * @param urgent The urgency of the need + * @param description The description of the need */ - public Need(String name, String location, double maxGoal, GoalType type, boolean urgent) { + public Need(String name, String image, String location, double maxGoal, GoalType type, boolean urgent, String description) { this.name = name; + this.image = image; this.location = location; this.type = type; this.maxGoal = maxGoal; this.urgent = urgent; + this.description = description; } /** @@ -61,6 +70,7 @@ public class Need { */ public Need(Need other) { this.name = other.name; + this.image = other.image; this.location = other.location; this.id = other.id; this.filterAttributes = other.filterAttributes; @@ -68,6 +78,7 @@ public class Need { this.maxGoal = other.maxGoal; this.current = other.current; this.urgent = other.urgent; + this.description = other.description; } public String getName() { @@ -94,6 +105,7 @@ public class Need { return current; } + public void setCurrent(double current) { this.current = current; } |