@Test(expected = IllegalArgumentException.class) public void testIllegalAccessibilityValue() { JsonPrimitive jsonPrimitive = new JsonPrimitive("non-public"); adapter.deserialize(jsonPrimitive, 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);  }