Class SampleBean
- java.lang.Object
-
- com.gargoylesoftware.base.testing.SampleBean
-
- All Implemented Interfaces:
java.io.Serializable
public class SampleBean extends java.lang.Object implements java.io.Serializable
A simple bean class that can be used for testing purposes. All properties fire PropertyChangeEvents when changed.- Version:
- $Revision: 1.3 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
age_
private java.lang.String
name_
private java.beans.PropertyChangeSupport
propertyChangeSupport_
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SampleBean()
Create a new instance.SampleBean(java.lang.String name, int age)
Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listenerprotected void
assertNotNull(java.lang.String fieldName, java.lang.Object fieldValue)
Verify that the specified value is not null.int
getAge()
Return the age.java.lang.String
getName()
Return the name.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listenervoid
setAge(int age)
Set the age.void
setName(java.lang.String name)
Set the name.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
propertyChangeSupport_
private final java.beans.PropertyChangeSupport propertyChangeSupport_
-
name_
private java.lang.String name_
-
age_
private int age_
-
-
Method Detail
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener- Parameters:
listener
- The listener
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener- Parameters:
listener
- The listener
-
getName
public java.lang.String getName()
Return the name.- Returns:
- The name
-
setName
public void setName(java.lang.String name)
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(java.lang.String fieldName, java.lang.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
-
-