Skip to content
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

Add typeId constraint to create_adapter_manually.md #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion custom-objects/create_adapter_manually.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DateTimeAdapter extends TypeAdapter<DateTime> {
}
```

!> As of Hive 1.3.0, all adapters require a `typeId` instance variable!
!> As of Hive 1.3.0, all adapters require a `typeId` instance variable! The custom `typeId` must be an int between `0` and `223`.

The `typeId` instance variable assigns the number to be registered to that adapter. It has to be unique between all adapters.
The `read()` method is called when your object has to be read from the disk. Use the `BinaryReader` to read all the properties of your object. In the above sample, it is only an `int` containing `millisecondsSinceEpoch`.
Expand Down