Why generic type? Because I have to.
What I need is to serialize to String the class that contains objects of other classes that have to be serialized also. How can I deserialize them inside "fromString" method without generics? I cannot use inheritance because one of these inner objects have to be BigDecimals so I must use interface to make BigDecimals StringSerializable.
To be concrete, I have such class:
public class DiscreetTimeFunction<E extends StringSerializable>
implements StringSerializable
{
List<PolishDate> timepointStarts=new ArrayList<PolishDate>();
List<PolishDate> timepointEnds=new ArrayList<PolishDate>();
List<E> values=new ArrayList<E>();
(....)
}
I have to write to string whole object of this class, with lists of PolishDates (which inherit from GregorianCalendar) and E objects that can be BigDecimals or arrays of BigDecimals or other objects maybe in the future.
[ March 17, 2007: Message edited by: Maciej Wegorkiewicz ]