How to Force ObjectUtil.copy() to copy Transient attribute

I'd like to force the method ObjectUtil.copy() to copy the transient attribute...

Do you have a solution to do that?Or do you know another method to copy my Object?

Thank you very much,

Bat

Answers


Unfortunately, no.

[Transient] and byteArray.writeObject() are both native player implementations. There's no way to modify their behaviour / implementation.

You'd need to look into writing your own copy util method.


I solve that with the getter function, I put a condition in ma getter function to know if I'm in a context in wich one I want to copy the transient variable or no

public function get myVar():Object {
if (WantCopyTransient)
  return _myVar;
else
  return null;
}

Thanks for your answers


Need Your Help

Why PAINTSTRUCT in C is TpaintStruct in PASCAL?

c winapi pascal

I was looking through an application being ported from C to PASCAL (win32 API) and cannot understand, why the type PAINTSTRUCT in C changes to TpaintStruct in PASCAL.

Format Integer or String into Long Integer (No scientific notation/Truncated/Rounded Numbers)

php string integer number-formatting long-integer

Conclusion: Marc B's solution is a 64 Bit, but for 32 Bit I'm not sure you can get the accuracy needed