I need to check if all value is null in a Scala class (Test.class) defined as:
class Test extends Serializable {
a: String = _
b: String = _
c: String = _
}
I can't change this class (is legacy code in my project). How can i do this without a lot of if? The real class have 22 fields.
I've tried to use java reflection to detect the defined fields, but they are all defined every and I can't access it because the fields are private for the reflectors. (criteria.getClass.getDeclaredFields
)