Class PortalStorageHelper
java.lang.Object
org.sgrewritten.stargate.util.database.PortalStorageHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPortalPosition
(PreparedStatement addPositionStatement, RealPortal portal, PortalPosition portalPosition) static PortalData
loadPortalData
(String[] portalProperties, org.bukkit.World world, String defaultNetworkName) Load legacy datastatic @NotNull PortalData
loadPortalData
(ResultSet resultSet, StorageType portalType) Load portal data from sql result setstatic PortalPosition
loadPortalPosition
(ResultSet resultSet) Load a portal position from sql result set
-
Method Details
-
loadPortalData
@NotNull public static @NotNull PortalData loadPortalData(ResultSet resultSet, StorageType portalType) throws SQLException, PortalLoadException Load portal data from sql result set- Parameters:
resultSet
-Sql result set representing one row in the portals table
portalType
-How the portal is stored
- Returns:
Portal data which can be used to create a portal
- Throws:
SQLException
-If any sql problem
PortalLoadException
-See
PortalLoadException.FailureType
for causes
-
loadPortalPosition
public static PortalPosition loadPortalPosition(ResultSet resultSet) throws NumberFormatException, SQLException Load a portal position from sql result set- Parameters:
resultSet
-Sql row in table
- Returns:
A portal position based from the row in the table
- Throws:
NumberFormatException
-IF unable to parse integer
SQLException
-if any sql error
-
addPortalPosition
public static void addPortalPosition(PreparedStatement addPositionStatement, RealPortal portal, PortalPosition portalPosition) throws SQLException - Throws:
SQLException
-
loadPortalData
public static PortalData loadPortalData(String[] portalProperties, org.bukkit.World world, String defaultNetworkName) Load legacy data- Parameters:
portalProperties
-A data sequence in the format of legacy storage resembling a portal
world
-The world to load portal data for
- Returns:
The loaded portal data
-