Package jmri.beans

Class ArbitraryPropertySupport

  • All Implemented Interfaces:
    BeanInterface

    public class ArbitraryPropertySupport
    extends java.lang.Object
    implements BeanInterface
    Provide support for converging the Arbitrary* classes with the non-arbitrary versions of those classes so that the Arbitrary* version can extend the non-arbitrary class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getIndexedProperty​(java.lang.String key, int index)
      Get the value of an element in an indexed property.
      java.lang.Object getProperty​(java.lang.String key)
      Get the value of a property.
      java.util.Set<java.lang.String> getPropertyNames()
      List all property names or keys.
      boolean hasIndexedProperty​(java.lang.String key)
      Test that a property exists and is indexed.
      boolean hasProperty​(java.lang.String key)
      Test that a property exists.
      void setIndexedProperty​(java.lang.String key, int index, java.lang.Object value)
      Set the value of an element in an indexed property.
      void setProperty​(java.lang.String key, java.lang.Object value)
      Set the value of a property.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setIndexedProperty

        public void setIndexedProperty​(java.lang.String key,
                                       int index,
                                       java.lang.Object value)
        Set the value of an element in an indexed property.

        NOTE Implementing methods must not call Bean.setIndexedProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.setIntrospectedIndexedProperty() instead.

        Specified by:
        setIndexedProperty in interface BeanInterface
        Parameters:
        key - name of the property
        index - index of the property element to change
        value - the value to set the property to
      • getIndexedProperty

        public java.lang.Object getIndexedProperty​(java.lang.String key,
                                                   int index)
        Get the value of an element in an indexed property.

        NOTE Implementing methods must not call Bean.getIndexedProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.getIntrospectedIndexedProperty() instead.

        Specified by:
        getIndexedProperty in interface BeanInterface
        Parameters:
        key - name of the property
        index - index of the property element to change
        Returns:
        value of the property or null
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Object value)
        Set the value of a property.

        NOTE Implementing methods must not call Bean.setProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.setIntrospectedProperty() instead.

        Specified by:
        setProperty in interface BeanInterface
        Parameters:
        key - name of the property
        value - the value to set the property to
      • getProperty

        public java.lang.Object getProperty​(java.lang.String key)
        Get the value of a property.

        NOTE Implementing methods must not call Bean.getProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.getIntrospectedProperty() instead.

        Specified by:
        getProperty in interface BeanInterface
        Parameters:
        key - name of the property
        Returns:
        The value of the property or null
      • hasProperty

        public boolean hasProperty​(java.lang.String key)
        Test that a property exists.

        NOTE Implementing method must not call Bean.hasProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.hasIntrospectedProperty() instead.

        Specified by:
        hasProperty in interface BeanInterface
        Parameters:
        key - name of the property
        Returns:
        true is property key exists
      • hasIndexedProperty

        public boolean hasIndexedProperty​(java.lang.String key)
        Test that a property exists and is indexed.

        NOTE Implementing method must not call Bean.hasIndexedProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.hasIntrospectedIndexedProperty() instead.

        Specified by:
        hasIndexedProperty in interface BeanInterface
        Parameters:
        key - name of the property
        Returns:
        true is property key exists and is indexed
      • getPropertyNames

        public java.util.Set<java.lang.String> getPropertyNames()
        List all property names or keys.

        NOTE Implementing method must not call Bean.getPropertyNames(), as doing so will cause a stack overflow. Implementing methods may call Beans.getIntrospectedPropertyNames() instead.

        NOTE Implementations of this method should not return null.

        Specified by:
        getPropertyNames in interface BeanInterface
        Returns:
        property names or an empty Set.