-
public final class ModelsThe Models class provides a way to manage and access models that collect and expose data. Custom models can be added to the collection as long as they do not conflict with base models. The following base models are always included and cannot be overridden:
-
-
Method Summary
Modifier and Type Method Description final <T extends Model<?>> Tget(Class<T> clazz)Retrieves a model of the specified class. final <T extends Model<?>> Tget()Retrieves a model of the specified class. final <ERROR CLASS>all()Retrieves all models in the collection. final <T extends Model<?>> UnitplusAssign(T model)Adds a custom model to the collection. final <T extends Model<?>> Unitadd(T model)Adds a custom model to the collection. final <T extends Model<?>> <ERROR CLASS>remove()Removes a model of the specified type from the collection. final <T extends Model<?>> Unitremove(KClass<T> clazz)Removes a model of the specified type from the collection. final <T extends Model<?>> Unitremove(Class<T> clazz)Removes a model of the specified type from the collection. final <T extends Model<?>> UnitminusAssign(KClass<T> model)Removes a model of the specified type from the collection. -
-
Constructor Detail
-
Models
Models(Model<?> customModels)
Creates a new collection of models including the specified custom models.- Parameters:
customModels- Custom models to be added to the collection.
-
-
Method Detail
-
get
final <T extends Model<?>> T get(Class<T> clazz)
Retrieves a model of the specified class.
- Parameters:
clazz- The class, which is type T, of the model to retrieve.
-
all
final <ERROR CLASS> all()
Retrieves all models in the collection.
-
plusAssign
final <T extends Model<?>> Unit plusAssign(T model)
Adds a custom model to the collection.
- Parameters:
model- The custom model to add.
-
add
final <T extends Model<?>> Unit add(T model)
Adds a custom model to the collection.
- Parameters:
model- The custom model to add.
-
remove
final <T extends Model<?>> <ERROR CLASS> remove()
Removes a model of the specified type from the collection.
-
remove
final <T extends Model<?>> Unit remove(KClass<T> clazz)
Removes a model of the specified type from the collection.
- Parameters:
clazz- The class, which is type T, of the model to remove.
-
remove
final <T extends Model<?>> Unit remove(Class<T> clazz)
Removes a model of the specified type from the collection.
- Parameters:
clazz- The class, which is type T, of the model to remove.
-
minusAssign
final <T extends Model<?>> Unit minusAssign(KClass<T> model)
Removes a model of the specified type from the collection.
-
-
-
-