Interface PropertyContainer

All Known Implementing Classes:
AbstractPropertyContainer, SinglePropertyContainer

public interface PropertyContainer
Provides an interface for getting and setting Propertys and listening for changes to them.
Since:
3.2.0
Author:
Joel Uckelman
  • Method Details

    • getProperties

      Set<Property<?>> getProperties()
      Returns the Propertys known to this container.
      Returns:
      a set of known Propertys
    • setValue

      <T> void setValue(Property<T> prop, T value)
      Sets the value of a Property.
      Parameters:
      prop - the Property
      value - the value
    • getValue

      <T> T getValue(Property<T> prop)
      Gets the value of a Property.
      Parameters:
      prop - the Property
      Returns:
      the value
    • addPropertyListener

      void addPropertyListener(PropertyListener<Object> listener)
      Adds a listener for all changes to this container.
      Parameters:
      listener - the listener to add
    • removePropertyListener

      void removePropertyListener(PropertyListener<Object> listener)
      Removes a listener for all changes to this container.
      Parameters:
      listener - the listener to remove
    • hasListeners

      boolean hasListeners()
      Checks whether there are PropertyListeners for all changes to this container.
      Returns:
      true if there are listeners
    • getPropertyListeners

      List<PropertyListener<Object>> getPropertyListeners()
      Returns a list of PropertyListeners listening to all changes to this container.
      Returns:
      a list of listeners
    • addPropertyListener

      <T> void addPropertyListener(Property<T> prop, PropertyListener<? super T> listener)
      Adds a listener for a specific Property.
      Parameters:
      prop - the Property to listen on
      listener - the listener to add
    • removePropertyListener

      <T> void removePropertyListener(Property<T> prop, PropertyListener<? super T> listener)
      Removes a listener for a specific Property.
      Parameters:
      prop - the Property listened on
      listener - the listener to remove
    • getPropertyListeners

      <T> List<PropertyListener<? super T>> getPropertyListeners(Property<T> prop)
      Returns a list of PropertyListeners listening to a given Property.
      Parameters:
      prop - the Property listened on
      Returns:
      a list of listeners
    • hasListeners

      <T> boolean hasListeners(Property<T> prop)
      Checks whether there are PropertyListeners for a given Property.
      Returns:
      true if there are listeners for the given property