Package jmri.beans

Interface BeanInterface

    • Method Summary

      All Methods Instance Methods Abstract 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.
    • Method Detail

      • setIndexedProperty

        void setIndexedProperty​(@Nonnull
                                java.lang.String key,
                                int index,
                                @CheckForNull
                                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.

        Parameters:
        key - name of the property
        index - index of the property element to change
        value - the value to set the property to
      • getIndexedProperty

        @CheckForNull
        java.lang.Object getIndexedProperty​(@Nonnull
                                            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.

        Parameters:
        key - name of the property
        index - index of the property element to change
        Returns:
        value of the property or null
      • setProperty

        void setProperty​(@Nonnull
                         java.lang.String key,
                         @CheckForNull
                         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.

        Parameters:
        key - name of the property
        value - the value to set the property to
      • getProperty

        @CheckForNull
        java.lang.Object getProperty​(@Nonnull
                                     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.

        Parameters:
        key - name of the property
        Returns:
        The value of the property or null
      • hasProperty

        boolean hasProperty​(@Nonnull
                            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.

        Parameters:
        key - name of the property
        Returns:
        true is property key exists
      • hasIndexedProperty

        boolean hasIndexedProperty​(@Nonnull
                                   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.

        Parameters:
        key - name of the property
        Returns:
        true is property key exists and is indexed
      • getPropertyNames

        @Nonnull
        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.

        Returns:
        property names or an empty Set.