org.specrunner.reuse.core
Class AbstractReusable<T>

java.lang.Object
  extended by org.specrunner.reuse.core.AbstractReusable<T>
Type Parameters:
T - The resource object type.
All Implemented Interfaces:
IReusable<T>

public abstract class AbstractReusable<T>
extends Object
implements IReusable<T>

Partial reusable object implementation.

Author:
Thiago Santos

Field Summary
protected  String name
          A name given to the reusable resource.
protected  T object
          The reusable object instance.
 
Constructor Summary
AbstractReusable(String name, T object)
          Create a reusable resource with name and the object to be reused.
 
Method Summary
 String getName()
          Reusable name.
 T getObject()
          The reusable object.
 void setName(String name)
          Sets the reusable object name.
 void setObject(T object)
          Sets the reusable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.specrunner.reuse.IReusable
canReuse, release, reset
 

Field Detail

name

protected String name
A name given to the reusable resource.


object

protected T object
The reusable object instance.

Constructor Detail

AbstractReusable

public AbstractReusable(String name,
                        T object)
Create a reusable resource with name and the object to be reused.

Parameters:
name - The name.
object - The reusable object.
Method Detail

getName

public String getName()
Description copied from interface: IReusable
Reusable name.

Specified by:
getName in interface IReusable<T>
Returns:
The reusable resource name.

setName

public void setName(String name)
Sets the reusable object name.

Parameters:
name - The name.

getObject

public T getObject()
Description copied from interface: IReusable
The reusable object.

Specified by:
getObject in interface IReusable<T>
Returns:
Object.

setObject

public void setObject(T object)
Sets the reusable object.

Parameters:
object - The object.


Copyright © 2014. All rights reserved.