Package dev.plex.cache

# Class DataUtils

java.lang.Object
dev.plex.cache.DataUtils

public class DataUtils extends Object
Parent cache class

## Constructor Summary

Constructors
Constructor
Description
`DataUtils()`

## Method Summary

Modifier and Type
Method
Description
`static PlexPlayer`
`getPlayer(String username)`
`static PlexPlayer`
`getPlayer(String username, boolean loadExtraData)`
`static PlexPlayer`
`getPlayer(UUID uuid)`
Gets a player from cache or from the database
`static PlexPlayer`
`getPlayer(UUID uuid, boolean loadExtraData)`
`static PlexPlayer`
`getPlayerByIP(String ip)`
Gets a player from cache or from the database
`static boolean`
`hasPlayedBefore(String username)`
`static boolean`
`hasPlayedBefore(UUID uuid)`
Checks if the player has been on the server before
`static void`
`insert(PlexPlayer plexPlayer)`
Inserts a player's information in the database
`static void`
`update(PlexPlayer plexPlayer)`
Updates a player's information in the database

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DataUtils

public DataUtils()

## Method Details

### hasPlayedBefore

public static boolean hasPlayedBefore(UUID uuid)
Checks if the player has been on the server before

Parameters:
  `uuid` - The unique ID of the player
Returns:
  true if the player is registered in the database

### hasPlayedBefore

public static boolean hasPlayedBefore(String username)

### getPlayer

public static PlexPlayer getPlayer(UUID uuid)
Gets a player from cache or from the database

Parameters:
  `uuid` - The unique ID of the player
Returns:
  a PlexPlayer object
See Also:
  - `PlexPlayer`

### getPlayer

public static PlexPlayer getPlayer(UUID uuid, boolean loadExtraData)

### getPlayer

public static PlexPlayer getPlayer(String username)

### getPlayer

public static PlexPlayer getPlayer(String username, boolean loadExtraData)

### getPlayerByIP

public static PlexPlayer getPlayerByIP(String ip)
Gets a player from cache or from the database

Parameters:
  `ip` - The IP address of the player.
Returns:
  a PlexPlayer object
See Also:
  - `PlexPlayer`

### update

public static void update(PlexPlayer plexPlayer)
Updates a player's information in the database

Parameters:
  `plexPlayer` - The PlexPlayer to update
See Also:
  - `PlexPlayer`

### insert

public static void insert(PlexPlayer plexPlayer)
Inserts a player's information in the database

Parameters:
  `plexPlayer` - The PlexPlayer to insert
See Also:
  - `PlexPlayer`