We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently fury deserialize method return Object type, if users serialized an object of type Foo, users needs to cast to Foo manually:
Object
Foo
byte[] d = fury.serialize(foo); Object o = fury.deserialize(d); Foo o1 = (Foo) o;
This is inconvenient, and if there are generics such as:
Foo<A> foo = xxx; byte[] d = fury.serialize(foo); Object o = fury.deserialize(d); Foo<A> foo o1 = (Foo<A> foo) o;
the cast will issue a javac warnings.
Then users will need to warp an util like this:
@SuppressWarnings("unchecked") public static <T> T deserialize(byte[] b) { Object o = fury.deserialize(b); return (T) o; }
We should do this for users.
Implement cast in fuyr:
Note if users declare error type, the deserialization will raise ClassCastException:
Foo<A> foo = xxx; byte[] d = fury.serialize(foo); Bar o = fury.deserialize(d); // raise ClassCastException.
The text was updated successfully, but these errors were encountered:
This will make type infer ambigious
Maybe we should add a new method instead of update existing methods
Sorry, something went wrong.
Maybe add a new mthod instead?
public <T> T deserializeTyped(byte[] bytes) { return (T) deserialize(MemoryUtils.wrap(bytes), null); }
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
Currently fury deserialize method return
Object
type, if users serialized an object of typeFoo
, users needs to cast toFoo
manually:This is inconvenient, and if there are generics such as:
the cast will issue a javac warnings.
Then users will need to warp an util like this:
We should do this for users.
Describe the solution you'd like
Implement cast in fuyr:
Note if users declare error type, the deserialization will raise ClassCastException:
The text was updated successfully, but these errors were encountered: