X
- The type of the input to the constructorY
- The super class of the classes to be constructedpublic class ClassList<X,Y>
extends java.lang.Object
Constructor | Description |
---|---|
ClassList() |
Default constructor
|
Modifier and Type | Method | Description |
---|---|---|
void |
add(java.lang.String type,
java.util.function.Function<X,Y> constructor) |
Add a new child class
|
Y |
get(java.lang.String type,
X parameters) |
Get a new instance of the child class
|
boolean |
has(java.lang.String type) |
Whether the class list has a class associated with a string
|
public void add(java.lang.String type, java.util.function.Function<X,Y> constructor)
type
- The string representing the child classconstructor
- The constructor for that classpublic Y get(java.lang.String type, X parameters)
type
- The string representing the child classparameters
- The input parameter to the constructorpublic boolean has(java.lang.String type)
type
- The string