Class ArbitraryPropertySupport
- java.lang.Object
-
- jmri.beans.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.
-
-
Constructor Summary
Constructors Constructor Description ArbitraryPropertySupport(UnboundBean bean)
-
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.
-
-
-
Constructor Detail
-
ArbitraryPropertySupport
public ArbitraryPropertySupport(UnboundBean bean)
-
-
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 callBeans.setIntrospectedIndexedProperty()
instead.- Specified by:
setIndexedProperty
in interfaceBeanInterface
- Parameters:
key
- name of the propertyindex
- index of the property element to changevalue
- 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 callBeans.getIntrospectedIndexedProperty()
instead.- Specified by:
getIndexedProperty
in interfaceBeanInterface
- Parameters:
key
- name of the propertyindex
- 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 callBeans.setIntrospectedProperty()
instead.- Specified by:
setProperty
in interfaceBeanInterface
- Parameters:
key
- name of the propertyvalue
- 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 callBeans.getIntrospectedProperty()
instead.- Specified by:
getProperty
in interfaceBeanInterface
- 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 callBeans.hasIntrospectedProperty()
instead.- Specified by:
hasProperty
in interfaceBeanInterface
- 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 callBeans.hasIntrospectedIndexedProperty()
instead.- Specified by:
hasIndexedProperty
in interfaceBeanInterface
- 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 callBeans.getIntrospectedPropertyNames()
instead.NOTE Implementations of this method should not return null.
- Specified by:
getPropertyNames
in interfaceBeanInterface
- Returns:
- property names or an empty Set.
-
-