This is a curious situation: I have a bean like this that store some information and I need generics, because the field "data" can contain different types of data.

```
public class Request<T> {

    private String name;
    private Integer code;
    private T data;

    /* Getter and setters */
}

```

The fact is that "data" is not always used and sometimes it can be null. And if I want to avoid raw types I have to define a type anyway, like this:

```
Request<Object> req = ....

```

Is there a better way of doing that, where I can both 1) Avoid raw types 2) Have a generic data field in my request objects ???