mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
Change parameter names for clarification!
This commit is contained in:
@@ -22,16 +22,12 @@
|
|||||||
*/
|
*/
|
||||||
package io.github.jwdeveloper.tiktok.data.models.users;
|
package io.github.jwdeveloper.tiktok.data.models.users;
|
||||||
|
|
||||||
import io.github.jwdeveloper.tiktok.data.models.badges.Badge;
|
|
||||||
import io.github.jwdeveloper.tiktok.data.models.Picture;
|
import io.github.jwdeveloper.tiktok.data.models.Picture;
|
||||||
|
import io.github.jwdeveloper.tiktok.data.models.badges.Badge;
|
||||||
import io.github.jwdeveloper.tiktok.messages.webcast.*;
|
import io.github.jwdeveloper.tiktok.messages.webcast.*;
|
||||||
import lombok.AccessLevel;
|
import lombok.*;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public class User {
|
public class User {
|
||||||
@@ -49,12 +45,12 @@ public class User {
|
|||||||
return attributes.stream().toList();
|
return attributes.stream().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAttribute(UserAttribute userFlag) {
|
public boolean hasAttribute(UserAttribute attribute) {
|
||||||
return attributes.contains(userFlag);
|
return attributes.contains(attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAttribute(UserAttribute... flags) {
|
public void addAttribute(UserAttribute... attributes) {
|
||||||
this.attributes.addAll(Arrays.stream(flags).toList());
|
this.attributes.addAll(List.of(attributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGiftGiver() {
|
public boolean isGiftGiver() {
|
||||||
@@ -168,11 +164,11 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static User EMPTY = new User(0L,
|
public static User EMPTY = new User(0L,
|
||||||
"",
|
"",
|
||||||
Picture.empty(),
|
Picture.empty(),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
List.of(Badge.empty()));
|
List.of(Badge.empty()));
|
||||||
|
|
||||||
public static User map(io.github.jwdeveloper.tiktok.messages.data.User user) {
|
public static User map(io.github.jwdeveloper.tiktok.messages.data.User user) {
|
||||||
return new User(user);
|
return new User(user);
|
||||||
@@ -209,12 +205,12 @@ public class User {
|
|||||||
|
|
||||||
public static User map(WebcastEnvelopeMessage.EnvelopeInfo envelopeInfo) {
|
public static User map(WebcastEnvelopeMessage.EnvelopeInfo envelopeInfo) {
|
||||||
return new User(0L,
|
return new User(0L,
|
||||||
//envelopeInfo.getSendUserId(),
|
//envelopeInfo.getSendUserId(),
|
||||||
envelopeInfo.getSendUserName(),
|
envelopeInfo.getSendUserName(),
|
||||||
Picture.map(envelopeInfo.getSendUserAvatar()),
|
Picture.map(envelopeInfo.getSendUserAvatar()),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
List.of(Badge.empty()));
|
List.of(Badge.empty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user