diff --git a/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java b/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java index f9ee32b4..07e10a51 100644 --- a/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java +++ b/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java @@ -97,7 +97,7 @@ import com.google.gson.stream.JsonWriter; * Create a {@code RuntimeTypeAdapterFactory} by passing the base type and type field * name to the {@link #of} factory method. If you don't supply an explicit type * field name, {@code "type"} will be used.
{@code - * RuntimeTypeAdapterFactory* Next register all of your subtypes. Every subtype must be explicitly @@ -108,14 +108,14 @@ import com.google.gson.stream.JsonWriter; * shapeAdapter.registerSubtype(Circle.class, "Circle"); * shapeAdapter.registerSubtype(Diamond.class, "Diamond"); * } - * Finally, register the type adapter in your application's GSON builder: + * Finally, register the type adapter factory in your application's GSON builder: *shapeAdapter + * RuntimeTypeAdapterFactory shapeAdapterFactory * = RuntimeTypeAdapterFactory.of(Shape.class, "type"); * }
{@code * Gson gson = new GsonBuilder() - * .registerTypeAdapter(Shape.class, shapeAdapter) + * .registerTypeAdapterFactory(Shape.class, shapeAdapterFactory) * .create(); * }* Like {@code GsonBuilder}, this API supports chaining:
{@code - * RuntimeTypeAdapterFactoryshapeAdapter = RuntimeTypeAdapterFactory.of(Shape.class) + * RuntimeTypeAdapterFactory shapeAdapterFactory = RuntimeTypeAdapterFactory.of(Shape.class) * .registerSubtype(Rectangle.class) * .registerSubtype(Circle.class) * .registerSubtype(Diamond.class);