Record Class YUser
java.lang.Object
java.lang.Record
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.core.YUser
-
Constructor Summary
ConstructorsConstructorDescriptionYUser(net.dv8tion.jda.api.entities.User user) Creates an instance of aYUserrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull StringgetAsTag()The "tag" for this user@Nullable String@Nullable StringgetBot()@NotNull StringThe URL for the user's default avatar image.Set<net.dv8tion.jda.api.entities.User.UserFlag>getFlags()intnet.dv8tion.jda.api.JDAgetJDA()List<net.dv8tion.jda.api.entities.Guild>getName()@NotNull OffsetDateTimefinal inthashCode()Returns a hash code value for this object.booleanisBot()booleanisSystem()net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.PrivateChannel>@NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.User.Profile>Loads the user'sUser.Profiledata.final StringtoString()Returns a string representation of this record class.net.dv8tion.jda.api.entities.Useruser()Returns the value of theuserrecord component.
-
Constructor Details
-
YUser
public YUser(net.dv8tion.jda.api.entities.User user) Creates an instance of aYUserrecord class.- Parameters:
user- the value for theuserrecord component
-
-
Method Details
-
getUserTag
- See Also:
-
User.getAsTag()
-
getUserId
- See Also:
-
ISnowflake.getId()
-
getUserIdLong
- See Also:
-
ISnowflake.getIdLong()
-
getName
- See Also:
-
User.getName()
-
isBot
- See Also:
-
User.isBot()
-
getDiscriminator
- See Also:
-
User.getDiscriminator()
-
getAvatarId
- See Also:
-
User.getAvatarId()
-
getAvatarUrl
- See Also:
-
User.getAvatarUrl()
-
getDefaultAvatarId
- See Also:
-
User.getDefaultAvatarId()
-
getDefaultAvatarUrl
The URL for the user's default avatar image.- Returns:
- Never-null String containing the
Userdefault avatar url. - Throws:
UnsupportedOperationException- If this User was created with from id
-
getEffectiveAvatarUrl
- See Also:
-
User.getDefaultAvatarUrl()
-
retrieveProfile
@NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.User.Profile> retrieveProfile()Loads the user'sUser.Profiledata. Returns a completed RestAction if this User has been retrieved usingJDA.retrieveUserById(long).- Returns:
RestAction- Type:User.Profile- Throws:
UnsupportedOperationException- If this User was created with from id- Since:
- 4.3.0
-
getAsTag
The "tag" for this userThis is the equivalent of calling
String.format("%#s", user)- Returns:
- Never-null String containing the tag for this user, for example DV8FromTheWorld#6297
- Throws:
UnsupportedOperationException- If this User was created with fromId(long)
-
hasPrivateChannel
public boolean hasPrivateChannel()- See Also:
-
User.hasPrivateChannel()
-
openPrivateChannel
@Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.PrivateChannel> openPrivateChannel()- See Also:
-
User.openPrivateChannel()
-
getMutualGuilds
- See Also:
-
User.getMutualGuilds()
-
isSystem
public boolean isSystem()- See Also:
-
User.isSystem()
-
getJDA
@Nonnull public net.dv8tion.jda.api.JDA getJDA()- See Also:
-
User.getJDA()
-
getFlags
- See Also:
-
User.getFlags()
-
getFlagsRaw
public int getFlagsRaw()- See Also:
-
User.getFlagsRaw()
-
getAsMention
- See Also:
-
IMentionable.getAsMention()
-
getBot
- See Also:
-
getTimeCreated
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
user
public net.dv8tion.jda.api.entities.User user()Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-