Skip to content

Elon Musk #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README-CHINESE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ Serializer是本库中的关键类,这个类提供了序列化和反序列化

- 对于那些有基类的对象,你可以用 ``CoreSerializers`` 中的getBaseClassSerializer(),它会通过子类serializers构造出基类的serializer。

- 举个例子,比如ClassC和ClassB都继承自ClassA。你想要将当前对象序列化为ClassA的类型,你可以在ClassA中通过子类的serializer方法来建立一个SERIALIZER
- 举个例子,比如ClassA和ClassB都继承自ClassC。你想要将当前对象序列化为ClassC的类型,你可以在ClassC中通过子类的serializer方法来建立一个SERIALIZER

.. code-block:: java

final Serializer<ClassA> SERIALIZER = CoreSerializers.getBaseClassSerializer(
SerializableClass.create(ClassC.class, new ClassC.ClassCSerializer()),
final Serializer<ClassC> SERIALIZER = CoreSerializers.getBaseClassSerializer(
SerializableClass.create(ClassA.class, new ClassA.ClassASerializer()),
SerializableClass.create(ClassB.class, new ClassB.ClassBSerializer()));

..
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ Serialization Utility Methods
- In order to serialize an object as its base class, you can construct a base class serializer from the subclass's
serializers using the getBaseClassSerializer in ``Serializers``

- For example, if you have ClassB and ClassC that both extend ClassA, and you want to serialize the objects as
ClassA objects, you can create a serializer in ClassA using the serializers of the subclasses:
- For example, if you have ClassA and ClassB that both extend ClassC, and you want to serialize the objects as
ClassC objects, you can create a serializer in ClassC using the serializers of the subclasses:

.. code-block:: java

Expand Down