I have a class which is handling objects same way. It's like:
class Handler<T>{
private T _obj;
public T obj{
get{
...//do sth
return _obj;
}
set{
...//do sth
_obj = value;
}
}
... // some other properties, no T anymore
}
There are large amount of code working on Handler
objects, ignoring type. I mean, type T
is not for them, there are setting other fields.
There are containers with Handler<>
and so on.
At the end I need to return Handler with correct type.
I wanted to use Handler<object>
, but there is no way I know to convert it to Handler<SomeClass>
.
How can I handle situtations like this?