Thank you.
I my class A, it has a reference to B.
When A is emitted to next bolt, I found that when I access B, it's null.
So I think it's neccesory to implement serializable for B.
From: Dan DeCapria, CivicScience
Date: 2014-10-22 22:27
To: user
Subject: Re: Must a inner class be serialized to emit ?
I believe you need to implement Serializable for both classes. For example, I
use:
public class A implements Serializable {
public static class B implements Serializable {
public B() {/*default constructor required*/}
@Override
public String toString() { /*stuff*/}
@Override
public boolean equals(Object obj) {/*stuff*/}
@Override
public int hashCode() {/*stuff*/}
}
}
Hope this helps, -Dan
On Wed, Oct 22, 2014 at 7:06 AM, Samit Sasan <[email protected]> wrote:
My guess is only if Class A holds a reference to an object of Class B,
otherwise its fine.
-Samit
On Wed, Oct 22, 2014 at 3:35 PM, [email protected] <[email protected]>
wrote:
for example:
public Class A implements Serializable {
Class B{
....
}
}
my question is if B should implements Serializable to be transfer to another
component ?
--
Dan DeCapria
CivicScience, Inc.
Back-End Data IS/BI/DM/ML Specialist