Package net.paulem.arcana.utils
Class PersistentDataUtils
java.lang.Object
net.paulem.arcana.utils.PersistentDataUtils
Utility methods for working with Bukkit's
PersistentDataType system.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <P,C> org.bukkit.persistence.PersistentDataType <P, C> getCorrespondType(C constable) Resolves the built-inPersistentDataTypethat corresponds to the runtime type of the given value.
-
Constructor Details
-
PersistentDataUtils
public PersistentDataUtils()
-
-
Method Details
-
getCorrespondType
public static <P,C> org.bukkit.persistence.PersistentDataType<P,C> getCorrespondType(C constable) Resolves the built-inPersistentDataTypethat corresponds to the runtime type of the given value. SupportsByte,Short,Integer,Long,Float,Double,Boolean,String,byte[],int[]andlong[].- Type Parameters:
P- the primitive persistent data typeC- the complex/runtime type of the value- Parameters:
constable- a sample value whose type determines the returnedPersistentDataType- Returns:
- the
PersistentDataTypematching the runtime type ofconstable - Throws:
IllegalArgumentException- ifconstableisnullor its type is not supported
-