예제 #1
0
  /**
   * Reads configuration.
   *
   * @return configuration
   * @throws JsonSyntaxException when parse fails
   * @throws IOException when read fails
   */
  public static BalanceConfiguration readBalanceConfig() throws JsonParseException, IOException {

    Gson gson = new Gson();
    return gson.fromJson(
        readConfig(WriteReadType.NORMAL, ConfigType.BALANCE.getFileName()).toString(),
        BalanceConfiguration.class);
  }
예제 #2
0
  /**
   * Writes configuration.
   *
   * @param writeType write type
   * @throws IOException when write fails
   */
  public static void writeBalanceConfig(BalanceConfiguration config, WriteReadType writeType)
      throws IOException {

    Gson gson = new Gson();
    writeConfig(gson.toJson(config), writeType, ConfigType.BALANCE.getFileName());
  }