Class Account

java.lang.Object
com.github.mafelp.accounts.Account

public class Account
extends java.lang.Object
The method that stores all necessary information about an account with linked discord user and minecraft player.
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.lang.String mentionTag
    The tag used to mention a Discord User in a discord message.
    private org.bukkit.OfflinePlayer player
    The minecraft OfflinePlayer to link the discord User to.
    private java.util.UUID playerUUID
    The UUID of the minecraft player.
    private org.javacord.api.entity.user.User user
    The discord user
    private long userID
    the discord ID of the user.
    private java.lang.String username
    The name of the account.
  • Constructor Summary

    Constructors
    Constructor Description
    Account​(org.javacord.api.entity.user.User user, org.bukkit.OfflinePlayer player)
    The constructor to create an account from a minecraft playerUUID and a discord userID.
  • Method Summary

    Modifier and Type Method Description
    static java.util.Optional<Account> getByDiscordUser​(org.javacord.api.entity.user.User user)
    The method to get an Account by the User it belongs to.
    static java.util.Optional<Account> getByPlayer​(org.bukkit.OfflinePlayer player)
    The method to get an Account by the OfflinePlayer it belongs to.
    static java.util.Optional<Account> getByUsername​(java.lang.String username)
    The method to get an Account by the username it belongs to.
    java.lang.String getMentionTag()
    The getter for the mentionTag.
    org.bukkit.OfflinePlayer getPlayer()
    The getter for the player.
    java.util.UUID getPlayerUUID()
    The getter for the playerUUID.
    org.javacord.api.entity.user.User getUser()
    The getter for the user.
    long getUserID()
    The getter for the userID.
    java.lang.String getUsername()
    The getter for the username.
    Account setUsername​(java.lang.String username)
    The setter for the username.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • user

      private final org.javacord.api.entity.user.User user
      The discord user
    • userID

      private final long userID
      the discord ID of the user.
    • username

      private java.lang.String username
      The name of the account. The default is the discord name of the user.
    • mentionTag

      private final java.lang.String mentionTag
      The tag used to mention a Discord User in a discord message.
    • player

      private final org.bukkit.OfflinePlayer player
      The minecraft OfflinePlayer to link the discord User to.
    • playerUUID

      private final java.util.UUID playerUUID
      The UUID of the minecraft player.
  • Constructor Details

    • Account

      public Account​(org.javacord.api.entity.user.User user, org.bukkit.OfflinePlayer player)
      The constructor to create an account from a minecraft playerUUID and a discord userID.
      Parameters:
      user - The discord User to link this account to.
      player - The minecraft Player to link this account to.
  • Method Details

    • getUser

      public org.javacord.api.entity.user.User getUser()
      The getter for the user.
      Returns:
      The user field.
    • getUserID

      public long getUserID()
      The getter for the userID.
      Returns:
      The userID field.
    • getUsername

      public java.lang.String getUsername()
      The getter for the username.
      Returns:
      The username field.
    • setUsername

      public Account setUsername​(java.lang.String username)
      The setter for the username.
      Parameters:
      username - the username to set.
      Returns:
      The username field.
    • getMentionTag

      public java.lang.String getMentionTag()
      The getter for the mentionTag.
      Returns:
      The mentionTag field.
    • getPlayer

      public org.bukkit.OfflinePlayer getPlayer()
      The getter for the player.
      Returns:
      The player field.
    • getPlayerUUID

      public java.util.UUID getPlayerUUID()
      The getter for the playerUUID.
      Returns:
      The playerUUID field.
    • getByPlayer

      public static java.util.Optional<Account> getByPlayer​(org.bukkit.OfflinePlayer player)
      The method to get an Account by the OfflinePlayer it belongs to.
      Parameters:
      player - the OfflinePlayer to get the Account of.
      Returns:
      the Optional of an Account: If this account does not exists, it is empty.
    • getByDiscordUser

      public static java.util.Optional<Account> getByDiscordUser​(org.javacord.api.entity.user.User user)
      The method to get an Account by the User it belongs to.
      Parameters:
      user - the User to get the Account of.
      Returns:
      the Optional of an Account: If this account does not exists, it is empty.
    • getByUsername

      public static java.util.Optional<Account> getByUsername​(java.lang.String username)
      The method to get an Account by the username it belongs to.
      Parameters:
      username - the username to get the Account of.
      Returns:
      the Optional of an Account: If this account does not exists, it is empty.