Skip to content

Add serialization support (while still keeping backwards compatibility)#8

Open
aasaru wants to merge 1 commit intofizzed:masterfrom
aasaru:add-serializability
Open

Add serialization support (while still keeping backwards compatibility)#8
aasaru wants to merge 1 commit intofizzed:masterfrom
aasaru:add-serializability

Conversation

@aasaru
Copy link

@aasaru aasaru commented Mar 28, 2016

I propose adding serialization support to PDU-s. I have tested it and it worked fine.

User can still break serialization by adding non-serializable object to a PDU using setReferenceObject(). It would be possible to change the method signature for this method so it would take only a serializable parameter but this would break backwards compatibility so I just added a comment.

The other way would be to deprecate current method and add new method, something like this:
/**
* @deprecated Replaced by {@link #setReference(Object)}
*/
@deprecated
public void setReferenceObject(Object value) {
this.referenceObject = value;
}

public <T extends Serializable> void setReference(T value) {
    this.referenceObject = value;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments