@Test public void testFemaleCharacterToJson () { CharacterSlot slot = new CharacterSlot(10, "name", CharacterSlot.GENDER.FEMALE, "skinColor", "hairColor", "hairStyle", "beart"); JsonObject json = slot.toJson(); assertEquals(new Integer(10), json.getInteger("cid")); assertEquals("name", json.getString("name")); assertEquals("female", json.getString("gender")); assertEquals("skinColor", json.getString("skinColor")); assertEquals("hairColor", json.getString("hairColor")); assertEquals("hairStyle", json.getString("hairStyle")); assertEquals("beart", json.getString("beart")); }
public JsonObject toJson () { JsonObject json = new JsonObject(); json.put("cid", this.cid); json.put("name", this.name); json.put("gender", this.gender.toString().toLowerCase()); json.put(TEXT_SKINCOLOR, this.skinColor); json.put(TEXT_HAIRCOLOR, this.hairColor); json.put(TEXT_HAIRSTYLE, this.hairStyle); json.put(TEXT_BEART, this.beart); return json; }
CharacterSlot { public JsonObject toJson () { JsonObject json = new JsonObject(); json.put("cid", this.cid); json.put("name", this.name); json.put("gender", this.gender.toString().toLowerCase()); json.put(TEXT_SKINCOLOR, this.skinColor); json.put(TEXT_HAIRCOLOR, this.hairColor); json.put(TEXT_HAIRSTYLE, this.hairStyle); json.put(TEXT_BEART, this.beart); return json; } }
CharacterSlot { public JsonObject toJson () { JsonObject json = new JsonObject(); json.put("cid", this.cid); json.put("name", this.name); json.put("gender", this.gender.toString().toLowerCase()); json.put(TEXT_SKINCOLOR, this.skinColor); json.put(TEXT_HAIRCOLOR, this.hairColor); json.put(TEXT_HAIRSTYLE, this.hairStyle); json.put(TEXT_BEART, this.beart); return json; } CharacterSlot(final int cid, final String name, final GENDER gender, String skinColor, String hairColor, String hairStyle, String beart); }
CharacterSlot { public JsonObject toJson () { JsonObject json = new JsonObject(); json.put("cid", this.cid); json.put("name", this.name); json.put("gender", this.gender.toString().toLowerCase()); json.put(TEXT_SKINCOLOR, this.skinColor); json.put(TEXT_HAIRCOLOR, this.hairColor); json.put(TEXT_HAIRSTYLE, this.hairStyle); json.put(TEXT_BEART, this.beart); return json; } CharacterSlot(final int cid, final String name, final GENDER gender, String skinColor, String hairColor, String hairStyle, String beart); int getCID(); String getName(); GENDER getGender(); String getSkinColor(); String getHairColor(); String getHairStyle(); String getBeart(); JsonObject toJson(); static CharacterSlot createDummyMaleCharacterSlot(); static CharacterSlot createDummyFemaleCharacterSlot(); static CharacterSlot createFromJson(int cid, String name, JsonObject json); static CharacterSlot create(String name, GENDER gender, String skinColor, String hairColor, String hairStyle, String beart); }
CharacterSlot { public JsonObject toJson () { JsonObject json = new JsonObject(); json.put("cid", this.cid); json.put("name", this.name); json.put("gender", this.gender.toString().toLowerCase()); json.put(TEXT_SKINCOLOR, this.skinColor); json.put(TEXT_HAIRCOLOR, this.hairColor); json.put(TEXT_HAIRSTYLE, this.hairStyle); json.put(TEXT_BEART, this.beart); return json; } CharacterSlot(final int cid, final String name, final GENDER gender, String skinColor, String hairColor, String hairStyle, String beart); int getCID(); String getName(); GENDER getGender(); String getSkinColor(); String getHairColor(); String getHairStyle(); String getBeart(); JsonObject toJson(); static CharacterSlot createDummyMaleCharacterSlot(); static CharacterSlot createDummyFemaleCharacterSlot(); static CharacterSlot createFromJson(int cid, String name, JsonObject json); static CharacterSlot create(String name, GENDER gender, String skinColor, String hairColor, String hairStyle, String beart); static final String TEXT_SKINCOLOR; static final String TEXT_HAIRCOLOR; static final String TEXT_HAIRSTYLE; static final String TEXT_BEART; }