private SegmentSpecialBlock deserializeSpecialBlock( JsonObject json, JsonDeserializationContext context) { SegmentSpecialBlock segment = new SegmentSpecialBlock(); if (json.has("meta")) { segment.meta = json.get("meta").getAsInt(); json.remove("meta"); } if (json.has("isAlwaysBreakable")) { segment.isAlwaysBreakable = json.get("isAlwaysBreakable").getAsBoolean(); json.remove("isAlwaysBreakable"); } return segment; }
private void serializeSpecialBlock( SegmentSpecialBlock segment, JsonObject json, JsonSerializationContext context) { json.addProperty("meta", segment.getMeta()); json.addProperty("isAlwaysBreakable", segment.isAlwaysBreakable); }