T
- the (base) type of domain objects in the container@Incubating public interface PolymorphicDomainObjectContainer<T> extends NamedDomainObjectContainer<T>
NamedDomainObjectContainer
that allows to create domain objects with different types.Modifier and Type | Method and Description |
---|---|
<U extends T> |
create(String name,
Class<U> type)
Creates a domain object with the specified name and type, and adds it to the container.
|
<U extends T> |
create(String name,
Class<U> type,
Action<? super U> configuration)
Creates a domain object with the specified name and type, adds it to the container, and configures
it with the specified action.
|
configure, create, create, maybeCreate
findAll, matching, matching, withType
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules
all, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
<U extends T> U create(String name, Class<U> type) throws InvalidUserDataException
U
- the type of the domain object to be createdname
- the name of the domain object to be createdtype
- the type of the domain object to be createdInvalidUserDataException
- if a domain object with the specified name already exists
or the container does not support creating a domain object with the specified type<U extends T> U create(String name, Class<U> type, Action<? super U> configuration) throws InvalidUserDataException
U
- the type of the domain object to be createdname
- the name of the domain object to be createdtype
- the type of the domain object to be createdconfiguration
- an action for configuring the domain objectInvalidUserDataException
- if a domain object with the specified name already exists
or the container does not support creating a domain object with the specified type