@Test(expected = JsonParseException.class) public void testUnparsableAccessibility() { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("accessibility", "Public"); adapter.deserialize(jsonObject, Accessibility.class, null); }
@Override public Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (!json.isJsonPrimitive()) { throw new JsonParseException("Accessibility must be a JSON string"); } return Accessibility.fromValue(json.getAsString()); }
AccessibilityTypeAdapterDeserializer implements TypeAdapterDeserializer<Accessibility> { @Override public Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (!json.isJsonPrimitive()) { throw new JsonParseException("Accessibility must be a JSON string"); } return Accessibility.fromValue(json.getAsString()); } }
AccessibilityTypeAdapterDeserializer implements TypeAdapterDeserializer<Accessibility> { @Override public Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (!json.isJsonPrimitive()) { throw new JsonParseException("Accessibility must be a JSON string"); } return Accessibility.fromValue(json.getAsString()); }  }
AccessibilityTypeAdapterDeserializer implements TypeAdapterDeserializer<Accessibility> { @Override public Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (!json.isJsonPrimitive()) { throw new JsonParseException("Accessibility must be a JSON string"); } return Accessibility.fromValue(json.getAsString()); }  @Override Class<?> getAdaptedType(); @Override Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context); }
AccessibilityTypeAdapterDeserializer implements TypeAdapterDeserializer<Accessibility> { @Override public Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { if (!json.isJsonPrimitive()) { throw new JsonParseException("Accessibility must be a JSON string"); } return Accessibility.fromValue(json.getAsString()); }  @Override Class<?> getAdaptedType(); @Override Accessibility deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context);  }