diff options
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model')
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/model/User.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/User.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/User.java index 1c1d474..6de1a8a 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/User.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/User.java @@ -51,12 +51,12 @@ public class User { basket.add(need.getId()); } - public Integer[] getBasketNeeds() { + public Integer[] getNeeds() { return basket.toArray(Integer[]::new); } - public void removeBasketNeed(Need need) { - basket.remove(need.getId()); + public boolean removeBasketNeed(Integer needID) { + return basket.remove(needID); } public User withoutPasswordHash() { @@ -71,4 +71,8 @@ public class User { this.passwordHash = other.passwordHash; } + public String toString() { + return this.username + "; basket: " + this.basket + "; type:" + this.type + "; hash: " + this.passwordHash; + } + } |