Interface MCRProcessableCollection

All Known Implementing Classes:
MCRProcessableDefaultCollection

public interface MCRProcessableCollection
Defines a collection of coherent MCRProcessable.
Author:
Matthias Eichner
  • Method Details

    • getName

      String getName()
      Returns a human readable name about this registry container.
      Returns:
      name of this container
    • add

      void add(MCRProcessable processable)
      Adds a new MCRProcessable to this container.
      Parameters:
      processable - the processable to add
    • remove

      void remove(MCRProcessable processable)
      Removes a MCRProcessable from the container.
    • stream

      Streams all MCRProcessable 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

      Map<String,Object> getProperties()
      Returns a map of properties assigned to this processable.
      Returns:
      the properties map
    • getProperty

      default Object getProperty(String name)
      A shortcut for getProperties().get(name).
      Parameters:
      name - the name of the property
      Returns:
      the property value or null
    • getPropertyAs

      default <T> T getPropertyAs(String name, Class<T> type)
      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 property
      type - object type of the property
      Returns:
      the property value or null
    • addListener

      void addListener(MCRProcessableCollectionListener listener)
      Adds a new listener.
      Parameters:
      listener - the listener to add
    • removeListener

      void removeListener(MCRProcessableCollectionListener listener)
      Removes a listener.
      Parameters:
      listener - the listener to remove