Skip to content

Commit

Permalink
Merge pull request google#793 from egor-n/patch-1
Browse files Browse the repository at this point in the history
Fix RuntimeTypeAdapterFactory javadoc
  • Loading branch information
JakeWharton committed Feb 19, 2016
2 parents 02838e1 + edaf59e commit a52828c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
* "Rectangle"}) are configurable.
*
* <h3>Registering Types</h3>
* Create a {@code RuntimeTypeAdapter} by passing the base type and type field
* 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. <pre> {@code
* RuntimeTypeAdapter<Shape> shapeAdapter
* = RuntimeTypeAdapter.of(Shape.class, "type");
* RuntimeTypeAdapterFactory<Shape> shapeAdapter
* = RuntimeTypeAdapterFactory.of(Shape.class, "type");
* }</pre>
* Next register all of your subtypes. Every subtype must be explicitly
* registered. This protects your application from injection attacks. If you
Expand All @@ -115,7 +115,7 @@
* .create();
* }</pre>
* Like {@code GsonBuilder}, this API supports chaining: <pre> {@code
* RuntimeTypeAdapter<Shape> shapeAdapter = RuntimeTypeAdapterFactory.of(Shape.class)
* RuntimeTypeAdapterFactory<Shape> shapeAdapter = RuntimeTypeAdapterFactory.of(Shape.class)
* .registerSubtype(Rectangle.class)
* .registerSubtype(Circle.class)
* .registerSubtype(Diamond.class);
Expand Down

0 comments on commit a52828c

Please sign in to comment.