Class SampleBean
java.lang.Object
com.gargoylesoftware.base.testing.SampleBean
- All Implemented Interfaces:
Serializable
A simple bean class that can be used for testing purposes. All
properties fire PropertyChangeEvents when changed.
- Version:
- $Revision: 1.3 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private String
private final PropertyChangeSupport
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance.SampleBean
(String name, int age) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a property change listenerprotected final void
assertNotNull
(String fieldName, Object fieldValue) Verify that the specified value is not null.int
getAge()
Return the age.getName()
Return the name.void
Remove a property change listenervoid
setAge
(int age) Set the age.void
Set the name.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
propertyChangeSupport_
-
name_
-
age_
private int age_
-
-
Constructor Details
-
SampleBean
public SampleBean()Create a new instance. -
SampleBean
Create a new instance.- Parameters:
name
- The name.age
- The age.
-
-
Method Details
-
addPropertyChangeListener
Add a property change listener- Parameters:
listener
- The listener
-
removePropertyChangeListener
Remove a property change listener- Parameters:
listener
- The listener
-
getName
Return the name.- Returns:
- The name
-
setName
Set the name.- Parameters:
name
- The new name.
-
getAge
public int getAge()Return the age.- Returns:
- The age.
-
setAge
public void setAge(int age) Set the age.- Parameters:
age
- The new age.
-
assertNotNull
protected final void assertNotNull(String fieldName, Object fieldValue) throws DetailedNullPointerException Verify that the specified value is not null. If it is then throw an exception- Parameters:
fieldName
- The name of the field to checkfieldValue
- The value of the field to check- Throws:
DetailedNullPointerException
- If fieldValue is null
-