/** * Reads configuration. * * @return configuration * @throws JsonSyntaxException when parse fails * @throws IOException when read fails */ public static ExperienceConfiguration readExperienceConfig() throws JsonParseException, IOException { Gson gson = new Gson(); return gson.fromJson( readConfig(WriteReadType.NORMAL, ConfigType.EXPERIENCE.getFileName()).toString(), ExperienceConfiguration.class); }
/** * Writes configuration. * * @param writeType write type * @throws IOException when write fails */ public static void writeExperienceConfig(ExperienceConfiguration config, WriteReadType writeType) throws IOException { Gson gson = new Gson(); writeConfig(gson.toJson(config), writeType, ConfigType.EXPERIENCE.getFileName()); }