Package net.minheur.potoflux.utils
Class Json
java.lang.Object
net.minheur.potoflux.utils.Json
Class to get a
This allows to have less as possible in the project.
Gson.This allows to have less as possible in the project.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.GsonUse this to do your simple JSON commands. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetFromObject(String url, String key) Gets a string item from an online JSON objectstatic com.google.gson.JsonObjectGets a JSON object from an online filelistFromObject(com.google.gson.JsonObject object, String listName) loadStringArray(String url)
-
Field Details
-
GSON
public static final com.google.gson.Gson GSONUse this to do your simple JSON commands.
-
-
Method Details
-
loadStringArray
-
listFromObject
- Parameters:
object- theJsonObjectto get the list fromlistName- the member name of the list in the JSON- Returns:
- the list of string contained in the object
-
getOnlineJsonObject
Gets a JSON object from an online file- Parameters:
url- the path to file- Returns:
- the JSON object of the file
-
getFromObject
Gets a string item from an online JSON object- Parameters:
url- the link to your online JSON file containing your JSON objectkey- the key to the member of your object- Returns:
- the content of the member
keyin your online JSON object
-