Package net.tnemc.item.persistent
Class PersistentDataHolder
java.lang.Object
net.tnemc.item.persistent.PersistentDataHolder
PersistentDataHolder
- Since:
- 0.2.0.0
- Author:
- creatorfromhell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode
(JSONHelper json, ItemPlatform<?, ?, ?> platform) Decodes the provided JSON object and returns an Optional containing the decoded PersistentDataType.getData()
void
readJSON
(org.json.simple.JSONObject json, ItemPlatform<?, ?, ?> platform) Decodes theJSON object
and sets the values in the current instance.org.json.simple.JSONObject
toJSON()
Convert a PersistentDataHolder object to a JSONObject.
-
Constructor Details
-
PersistentDataHolder
public PersistentDataHolder()
-
-
Method Details
-
readJSON
Decodes theJSON object
and sets the values in the current instance.- Parameters:
json
- TheJSON object
to be decoded- Since:
- 0.2.0.0
-
toJSON
Convert a PersistentDataHolder object to a JSONObject.- Returns:
- The JSONObject representation of the PersistentDataHolder object.
- Since:
- 0.2.0.0
-
decode
Decodes the provided JSON object and returns an Optional containing the decoded PersistentDataType.- Parameters:
json
- The JSONHelper object to be decoded- Returns:
- An Optional containing the decoded PersistentDataType if it exists, otherwise an empty Optional
- Since:
- 0.2.0.0
-
getData
-