I am using generics in my class. MyObject must use T as an class, e.g. new MyObject(Long.class). In the method equal I want to ensure that the argument given to the method is an instance of T.
Object<T> is not a valid Java Source, I know.
I added it to the code example to show you what I mean, i.e. that value is an instance of T.
But what is the correct way to implement the equal method??
public class MyObject<T extends Class> {
public boolean equal(Object<T> value) {
return true;
}
}