Class AllowedMentionsBuilder
- java.lang.Object
-
- org.javacord.api.entity.message.mention.AllowedMentionsBuilder
-
public class AllowedMentionsBuilder extends Object
This class is used to create mentions.
-
-
Constructor Summary
Constructors Constructor Description AllowedMentionsBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AllowedMentionsBuilderaddRole(long roleId)Adds a role to the list which will be mentioned.AllowedMentionsBuilderaddRole(String roleId)Adds a role to the list which will be mentioned.AllowedMentionsBuilderaddRoles(Collection<Long> roleIds)Adds the roles to the list which will be mentioned.AllowedMentionsBuilderaddUser(long userId)Adds a user to the list which will be mentioned.AllowedMentionsBuilderaddUser(String userId)Adds a user to the list which will be mentioned.AllowedMentionsBuilderaddUsers(Collection<Long> userIds)Adds the users to the list which will be mentioned.AllowedMentionsbuild()Creates aAllowedMentionsinstance with the given values.AllowedMentionsBuilderDelegategetDelegate()Gets the delegate used by this mentions builder internally.AllowedMentionsBuilderremoveRole(long roleId)Removes a role from the list which will be mentioned.AllowedMentionsBuilderremoveRole(String roleId)Removes a role from the list which will be mentioned.AllowedMentionsBuilderremoveRoles(Collection<Long> roleIds)Removes the roles from the list which will be mentioned.AllowedMentionsBuilderremoveUser(long userId)Removes an user from the list which will be mentioned.AllowedMentionsBuilderremoveUser(String userId)Removes an user from the list which will be mentioned.AllowedMentionsBuilderremoveUsers(Collection<Long> userIds)Removes the users from the list which will be mentioned.AllowedMentionsBuildersetMentionEveryoneAndHere(boolean value)Mentions @everyone and @here.AllowedMentionsBuildersetMentionRoles(boolean value)Mentions all mentioned roles.AllowedMentionsBuildersetMentionUsers(boolean value)Mentions all mentioned users.
-
-
-
Method Detail
-
getDelegate
public AllowedMentionsBuilderDelegate getDelegate()
Gets the delegate used by this mentions builder internally.- Returns:
- The delegate used by this mention builder internally.
-
setMentionRoles
public AllowedMentionsBuilder setMentionRoles(boolean value)
Mentions all mentioned roles. This will override any explicit role mentions added viaaddRole(long)oraddRoles(Collection)- Parameters:
value- If roles should be mentioned or not.- Returns:
- The current instance in order to chain call methods.
-
setMentionUsers
public AllowedMentionsBuilder setMentionUsers(boolean value)
Mentions all mentioned users. This will override any explicit user mentions added viaaddUser(long)oraddUsers(Collection)- Parameters:
value- If users should be mentioned or not.- Returns:
- The current instance in order to chain call methods.
-
setMentionEveryoneAndHere
public AllowedMentionsBuilder setMentionEveryoneAndHere(boolean value)
Mentions @everyone and @here.- Parameters:
value- If @everyone and @here should be mentioned.- Returns:
- The current instance in order to chain call methods.
-
addRole
public AllowedMentionsBuilder addRole(String roleId)
Adds a role to the list which will be mentioned.- Parameters:
roleId- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
addRole
public AllowedMentionsBuilder addRole(long roleId)
Adds a role to the list which will be mentioned.- Parameters:
roleId- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
addRoles
public AllowedMentionsBuilder addRoles(Collection<Long> roleIds)
Adds the roles to the list which will be mentioned.- Parameters:
roleIds- A collection of role id's which will be mentioned.- Returns:
- The current instance in order to chain call methods.
-
addUser
public AllowedMentionsBuilder addUser(String userId)
Adds a user to the list which will be mentioned.- Parameters:
userId- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
addUser
public AllowedMentionsBuilder addUser(long userId)
Adds a user to the list which will be mentioned.- Parameters:
userId- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
addUsers
public AllowedMentionsBuilder addUsers(Collection<Long> userIds)
Adds the users to the list which will be mentioned.- Parameters:
userIds- A collection of user id's which will be mentioned.- Returns:
- The current instance in order to chain call methods.
-
removeRole
public AllowedMentionsBuilder removeRole(String roleId)
Removes a role from the list which will be mentioned.- Parameters:
roleId- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
removeRole
public AllowedMentionsBuilder removeRole(long roleId)
Removes a role from the list which will be mentioned.- Parameters:
roleId- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
removeRoles
public AllowedMentionsBuilder removeRoles(Collection<Long> roleIds)
Removes the roles from the list which will be mentioned.- Parameters:
roleIds- A collection of role id's which will be removed from the list.- Returns:
- The current instance in order to chain call methods.
-
removeUser
public AllowedMentionsBuilder removeUser(String userId)
Removes an user from the list which will be mentioned.- Parameters:
userId- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
removeUser
public AllowedMentionsBuilder removeUser(long userId)
Removes an user from the list which will be mentioned.- Parameters:
userId- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
removeUsers
public AllowedMentionsBuilder removeUsers(Collection<Long> userIds)
Removes the users from the list which will be mentioned.- Parameters:
userIds- A collection of user id's which will be removed from the list.- Returns:
- The current instance in order to chain call methods.
-
build
public AllowedMentions build()
Creates aAllowedMentionsinstance with the given values.- Returns:
- The created permissions instance.
-
-