aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java
diff options
context:
space:
mode:
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.java24
1 files changed, 23 insertions, 1 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 df65032..9187796 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
@@ -14,6 +14,14 @@ public class Need {
private double maxGoal;
private double current;
+ /**
+ * Create a new need
+ *
+ * @param name The name of the need
+ * @param id The unique ID of the need
+ * @param maxGoal The maximum goal for this need
+ * @param type The type of need (monetary, physical)
+ */
public Need(String name, int id, double maxGoal, GoalType type) {
this.id = id;
this.name = name;
@@ -21,11 +29,25 @@ public class Need {
this.type = type;
}
+ /**
+ * Create a deep copy of another need
+ *
+ * @param other The need to copy from
+ */
+ public Need(Need other) {
+ this.name = other.name;
+ this.id = other.id;
+ this.filterAttributes = other.filterAttributes;
+ this.type = other.type;
+ this.maxGoal = other.maxGoal;
+ this.current = other.current;
+ }
+
public String getName() {
return name;
}
- public int getID() {
+ public int getId() {
return id;
}