diff --git a/src/main/java/org/ntlab/amaryllis/server/entities/Account.java b/src/main/java/org/ntlab/amaryllis/server/entities/Account.java index 424e4e9..3791906 100644 --- a/src/main/java/org/ntlab/amaryllis/server/entities/Account.java +++ b/src/main/java/org/ntlab/amaryllis/server/entities/Account.java @@ -4,6 +4,8 @@ import org.ntlab.amaryllis.server.models.Accounts; import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; import java.util.UUID; public class Account { @@ -14,8 +16,8 @@ @JsonIgnore private String password; private String introduction; - private ArrayList followings; - private ArrayList followers; + private HashSet followings; + private HashSet followers; private ArrayList contributions; private ArrayList history; @@ -23,8 +25,8 @@ this.name = name; this.password = password; this.uid = UUID.randomUUID().toString(); - followings = new ArrayList<>(); - followers = new ArrayList<>(); + followings = new HashSet<>(); + followers = new HashSet<>(); history = new ArrayList<>(); contributions = new ArrayList<>(); introduction = ""; @@ -52,11 +54,11 @@ return contributions; } - public ArrayList getFollowers() { + public HashSet getFollowers() { return followers; } - public ArrayList getFollowings() { + public HashSet getFollowings() { return followings; } @@ -76,4 +78,14 @@ this.token = token; } + public void setName(String name) { + this.name = name; + } + public void setPassword(String password){ + this.password=password; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } }