To declare a type to easily retrieve it, you can add a string field in which you write the current type.
There is nothing like in Java with reflection etc to find out a type at runtime (although it is internally present) without the need to cast it and see if the answer is null
There is nothing like in Java with reflection etc to find out a type at runtime (although it is internally present) without the need to cast it and see if the answer is null