Class ConfigShare
java.lang.Object
dev.myriadclient.api.share.ConfigShare
A shared config: the modules, control panels, wheels and theme someone shared, with their settings (never protected ones),
plus how each looked in their menu, so the website can show it. Immutable; made by
ConfigShares.builder(),
fetched by ConfigShares.fetch(String), taken in by ConfigShares.apply(ConfigShare, ConfigShares.Apply).
The document is JSON, format 1:
{ "format": 1, "title": "...", "made": {"core": "0.3.4"}, "addons": [{"id", "name", "version"}],
"modules": [{"id", "enabled", "settings": {group: {setting: value}}, "view": {...}}],
"controlPanels": [{"name", "description", "members": [ids], "settings": {module: {setting: value}}}],
"wheels": [{"name", "icon", "keybind", "slots": [{"kind", "target", "label", "icon", "name"}]}],
"theme": {"name", "settings": {...}} }
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe document format this core writes and reads. -
Method Summary
Modifier and TypeMethodDescriptionaddons()The mod ids of the addons its modules come from.The names of the control panels in it.Its description, empty if it has none.booleanhasTheme()Whether it carries a theme.booleanisEmpty()Whether it has nothing in it.com.google.gson.JsonObjectjson()The document, as JSON (a copy).modules()The ids of the modules in it.static ConfigShareof(com.google.gson.JsonObject json) Wraps a document (a copy of it); throwsIllegalArgumentExceptionif it has noformatthis version reads.static ConfigShareReads a document from JSON text, astoString()writes it; throwsIllegalArgumentExceptionif it isn't a JSON object of a format this version reads (Gson's own exception for malformed JSON).title()Its title, "Shared config" if it has none.toString()The document as compact JSON text, whichparse(String)reads back.
-
Field Details
-
FORMAT
public static final int FORMATThe document format this core writes and reads.- See Also:
-
-
Method Details
-
of
Wraps a document (a copy of it); throwsIllegalArgumentExceptionif it has noformatthis version reads. -
parse
Reads a document from JSON text, astoString()writes it; throwsIllegalArgumentExceptionif it isn't a JSON object of a format this version reads (Gson's own exception for malformed JSON). -
json
public com.google.gson.JsonObject json()The document, as JSON (a copy). -
title
Its title, "Shared config" if it has none. -
description
Its description, empty if it has none. -
modules
-
controlPanels
-
hasTheme
public boolean hasTheme()Whether it carries a theme. -
addons
-
isEmpty
public boolean isEmpty()Whether it has nothing in it. -
toString
The document as compact JSON text, whichparse(String)reads back.
-