File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
API/src/main/java/io/github/jwdeveloper/tiktok/data/models/users Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,12 @@ public class User {
4343 private long followers ;
4444 private List <Badge > badges ;
4545 @ Getter (AccessLevel .NONE )
46- private Set <UserAttribute > attributes ;
47-
48-
46+ private final Set <UserAttribute > attributes = new HashSet <>();
4947
5048 public List <UserAttribute > getAttributes () {
5149 return attributes .stream ().toList ();
5250 }
51+
5352 public boolean hasAttribute (UserAttribute userFlag ) {
5453 return attributes .contains (userFlag );
5554 }
@@ -106,7 +105,6 @@ public User(Long userId,
106105 this .following = following ;
107106 this .followers = followers ;
108107 this .badges = badges ;
109- this .attributes = new HashSet <>();
110108 }
111109
112110 public User (Long id ,
@@ -123,14 +121,12 @@ public User(Long id,
123121 this .following = following ;
124122 this .followers = followers ;
125123 this .badges = badges ;
126- this .attributes = new HashSet <>();
127124 }
128125
129126 public User (Long userId ,
130127 String nickName ) {
131128 this .id = userId ;
132129 this .name = nickName ;
133- this .attributes = new HashSet <>();
134130 }
135131
136132 public User (Long userId ,
@@ -213,4 +209,4 @@ public static User map(WebcastEnvelopeMessage.EnvelopeInfo envelopeInfo) {
213209 0 ,
214210 List .of (Badge .empty ()));
215211 }
216- }
212+ }
You can’t perform that action at this time.
0 commit comments