Interface InstanceContainer<E>

All Known Subinterfaces:
CollectionContainer<E>, CollectionPropertyContainer<E>, InstancePropertyContainer<E>, KeyValueCollectionContainer, KeyValueContainer
All Known Implementing Classes:
CollectionContainerImpl, CollectionPropertyContainerImpl, InstanceContainerImpl, InstancePropertyContainerImpl, KeyValueCollectionContainerImpl, KeyValueContainerImpl

public interface InstanceContainer<E>
The root interface in the data containers hierarchy. Data containers represent a thin layer between visual components and entity instances and collections.

InstanceContainer holds a single entity instance.

See Also:
  • Method Details

    • getItem

      E getItem()
      Returns the contained entity instance.
      Throws:
      IllegalStateException - if there is no entity in the container
    • setItem

      void setItem(@Nullable E entity)
      Sets the given entity instance to the container.
    • getItemOrNull

      @Nullable E getItemOrNull()
      Returns the contained entity instance or null if there is no entity in the container.
    • getEntityMetaClass

      MetaClass getEntityMetaClass()
      Returns the meta-class of entities that can be stored in the container.
    • getFetchPlan

      @Nullable FetchPlan getFetchPlan()
      Returns the view which was set by previous call to setFetchPlan(FetchPlan). The view is normally used when loading entities for this container.
    • setFetchPlan

      void setFetchPlan(FetchPlan fetchPlan)
      Sets a view to be used when loading entities for this container.
    • addItemPropertyChangeListener

      Subscription addItemPropertyChangeListener(Consumer<InstanceContainer.ItemPropertyChangeEvent<E>> listener)
    • addItemChangeListener

      Subscription addItemChangeListener(Consumer<InstanceContainer.ItemChangeEvent<E>> listener)
    • mute

      void mute()
      Disables all event listeners on container data change.
      Can be used with unmute() for bulk data modification as a perfomance optimization.
    • unmute

      void unmute()
      Enables all event listeners. No events are fired on this call.