I am having some issues with the general concept of JSON files and writing to them. Currently, I have an ObjectMap of my game items, the issue is with changing this map. I have a class called item shown below, 

```
  public static class Item {
     public String name;
     public String type;
     public String rarity;
     public int reqLevel;
     int priceBuy;
     int priceSell;
     int amount = 0;
     public item() {}
     public void setAmount(int amnt) {amount = amnt;}
  }

```

So I have a json file of all these items in my game, I can load them in perfectly fine. What I want to do is change the amount of an Item I have using the setAmount or any other way, currently all the items are loaded into the ObjectMap. I posted below my save() and load(). I think I would need to change the item within the map before writing it back but I am struggling with getting it to do anything.

```
  public void save()
  {
      Json json = new Json();
      json.setOutputType(JsonWriter.OutputType.json);
      file.writeString(json.prettyPrint(items), false);
  }

  public void load() {
      Json json = new Json();
      items = json.fromJson(ObjectMap.class, file);
  }

```

EDIT: @Sneh
Actually I think it perfectly acceptable to do a fromJson of an ObjectMap.class, this is what the JSON file looks like, it is so you can have multiple items etc.

\*Could be wrong but it is loading and writing perfectly in scenarios I purposely create, what im having issues with is the changing of a specfic items amount variable!

```
//Test file with small amount of items
{
"SwordOfDeath": {
    "class": "com.johnny.gamerpg.InventoryController$Sword",
    "name": "Sword of Death",
    "type" : "Sword",
    "rarity": "Common",
    "reqLevel": 1,
    "proficiency": "Strength",
    "damageMax": 15,
    "damageMin": 2,
    "priceBuy": 1,
    "priceSell": 2,
    "bonusMagic": 0,
    "bonusStrength": 0,
    "bonusDexterity": 0,
    "bonusDefense": 0,
    "bonusLuck": 0,
    "amount": 2
},
"DaggerOfDeath": {
    "class": "com.johnny.gamerpg.InventoryController$Dagger",
    "name": "Dagger of Death",
    "type": "Dagger",
    "rarity": "Rare",
    "reqLevel": 3,
    "proficiency": "Dexterity",
    "damageMax": 15,
    "damageMin": 2,
    "priceBuy": 1,
    "priceSell": 2,
    "bonusMagic": 0,
    "bonusStrength": 0,
    "bonusDexterity": 0,
    "bonusDefense": 0,
    "bonusLuck": 0,
    "amount": 2
},
"DaggerOfLife": {
    "class": "com.johnny.gamerpg.InventoryController$Dagger",
    "name": "Dagger of Life",
    "type": "Dagger",
    "rarity": "Epic",
    "reqLevel": 5,
    "proficiency": "Dexterity",
    "damageMax": 15,
    "damageMin": 2,
    "priceBuy": 1,
    "priceSell": 2,
    "bonusMagic": 0,
    "bonusStrength": 0,
    "bonusDexterity": 0,
    "bonusDefense": 0,
    "bonusLuck": 0,
    "amount": 2
},
"LifeSword": {
    "class": "com.johnny.gamerpg.InventoryController$Sword",
    "name": "Life Sword",
    "type": "Sword",
    "rarity": "Legendary",
    "reqLevel": 45,
    "proficiency": "Strength",
    "damageMax": 100,
    "damageMin": 99,
    "priceBuy": 1000,
    "priceSell": 2000,
    "bonusMagic": 0,
    "bonusStrength": 5,
    "bonusDexterity": 0,
    "bonusDefense": 0,
    "bonusLuck": 10,
    "amount": 2
}
}

```