I have a situation where I am creating a data model class that has all the data points needed for a specific class. However depending on what is called in the class it does not need all the variables. The data model has multiple bounded type parameters however if not all are being used can some of them be optional?
For example:
public class DataModel<OBJ extends Object, EXCEPT extends Exception, MODEL extends BaseModelClass> {
}
Then when I instantiate it I might not need model and want to do something like:
DataModel<ClassA,RunTimeException,null> data = new DataModel<ClassA,RunTimeException,null>();
Where ClassA is a defined class that extends object in another part of the code and BaseModel is a company base model that has some very common pieces.
So the question is can something like this be done and have some of the bounded type parameters that apply to fields not being used for a specific submethod in this class be optional?