Package org.mycore.common.processing
Interface MCRProcessableCollection
- All Known Implementing Classes:
MCRProcessableDefaultCollection
public interface MCRProcessableCollection
Defines a collection of coherent
MCRProcessable
.- Author:
- Matthias Eichner
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(MCRProcessable processable) Adds a newMCRProcessable
to this container.void
addListener
(MCRProcessableCollectionListener listener) Adds a new listener.getName()
Returns a human readable name about this registry container.Returns a map of properties assigned to this processable.default Object
getProperty
(String name) A shortcut for getProperties().get(name).default <T> T
getPropertyAs
(String name, Class<T> type) Returns the property for the given name.boolean
isEmpty()
Checks if this collection contains any processable.void
remove
(MCRProcessable processable) Removes aMCRProcessable
from the container.void
Removes a listener.stream()
Streams allMCRProcessable
registered by this container.
-
Method Details
-
getName
String getName()Returns a human readable name about this registry container.- Returns:
- name of this container
-
add
Adds a newMCRProcessable
to this container.- Parameters:
processable
- the processable to add
-
remove
Removes aMCRProcessable
from the container. -
stream
Stream<MCRProcessable> stream()Streams allMCRProcessable
registered by this container.- Returns:
- stream of
MCRProcessable
-
isEmpty
boolean isEmpty()Checks if this collection contains any processable.- Returns:
- true if this collection contains at least on processable
-
getProperties
Returns a map of properties assigned to this processable.- Returns:
- the properties map
-
getProperty
A shortcut for getProperties().get(name).- Parameters:
name
- the name of the property- Returns:
- the property value or null
-
getPropertyAs
Returns the property for the given name. The property will be cast to the specified type. Be aware that a ClassCastException is thrown if the type does not match.- Parameters:
name
- name of propertytype
- object type of the property- Returns:
- the property value or null
-
addListener
Adds a new listener.- Parameters:
listener
- the listener to add
-
removeListener
Removes a listener.- Parameters:
listener
- the listener to remove
-