com.gargoylesoftware.base.testing
Class SampleBean

java.lang.Object
  extended bycom.gargoylesoftware.base.testing.SampleBean
All Implemented Interfaces:
Serializable

public class SampleBean
extends Object
implements Serializable

A simple bean class that can be used for testing purposes. All properties fire PropertyChangeEvents when changed.

Version:
$Revision: 1.4 $
Author:
Mike Bowler
See Also:
Serialized Form

Constructor Summary
SampleBean()
          Create a new instance.
SampleBean(String name, int age)
          Create a new instance.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a property change listener
protected  void assertNotNull(String fieldName, Object fieldValue)
          Verify that the specified value is not null.
 int getAge()
          Return the age.
 String getName()
          Return the name.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a property change listener
 void setAge(int age)
          Set the age.
 void setName(String name)
          Set the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleBean

public SampleBean()
Create a new instance.


SampleBean

public SampleBean(String name,
                  int age)
Create a new instance.

Parameters:
name - The name.
age - The age.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener

Parameters:
listener - The listener

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener

Parameters:
listener - The listener

getName

public String getName()
Return the name.

Returns:
The name

setName

public void setName(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(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 check
fieldValue - The value of the field to check
Throws:
DetailedNullPointerException - If fieldValue is null


Copyright © 1998-2005 Gargoyle Software Inc.. All Rights Reserved.