Package dev.plex.storage.player

# Class SQLPlayerData

java.lang.Object
dev.plex.storage.player.SQLPlayerData

public class SQLPlayerData extends Object
SQL fetching utilities for players

## Field Summary

Fields
Modifier and Type
Field
Description
`private final String`
`INSERT`
`private final String`
`SELECT`
`private final String`
`UPDATE`

## Constructor Summary

Constructors
Constructor
Description
`SQLPlayerData()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`exists(String username)`
`boolean`
`exists(UUID uuid)`
Checks if a player exists in the SQL database
`PlexPlayer`
`getByIP(String ip)`
Gets the player from cache or from the SQL database
`PlexPlayer`
`getByName(String username)`
`PlexPlayer`
`getByName(String username, boolean loadExtraData)`
`PlexPlayer`
`getByUUID(UUID uuid)`
`PlexPlayer`
`getByUUID(UUID uuid, boolean loadExtraData)`
Gets the player from cache or from the SQL database
`void`
`insert(PlexPlayer player)`
Inserts the player's information in the database
`void`
`update(PlexPlayer player)`
Updates a player's information in the SQL database

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

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

## Field Details

### SELECT

private final String SELECT

See Also:
  - Constant Field Values

### UPDATE

private final String UPDATE

See Also:
  - Constant Field Values

### INSERT

private final String INSERT

See Also:
  - Constant Field Values

## Constructor Details

### SQLPlayerData

public SQLPlayerData()

## Method Details

### exists

public boolean exists(UUID uuid)
Checks if a player exists in the SQL database

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

### exists

public boolean exists(String username)

### getByUUID

public PlexPlayer getByUUID(UUID uuid, boolean loadExtraData)
Gets the player from cache or from the SQL database

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

### getByUUID

public PlexPlayer getByUUID(UUID uuid)

### getByName

public PlexPlayer getByName(String username, boolean loadExtraData)

### getByName

public PlexPlayer getByName(String username)

### getByIP

public PlexPlayer getByIP(String ip)
Gets the player from cache or from the SQL database

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

### update

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

Parameters:
  `player` - The PlexPlayer object
See Also:
  - `PlexPlayer`

### insert

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

Parameters:
  `player` - The PlexPlayer object
See Also:
  - `PlexPlayer`