net.sourceforge.domian.factory
Class StrictReturnsNullFactory<T>
java.lang.Object
net.sourceforge.domian.factory.StrictReturnsNullFactory<T>
- All Implemented Interfaces:
- Factory
public final class StrictReturnsNullFactory<T>
- extends java.lang.Object
- implements Factory
Generic factory class creating objects based on Specification
s.
It is named strict because it returns null
rather than a possible imperfect object.
If the specification contains ambiguous data, or is somehow missing data, the factory will not construct any object.
Returns null object creation strategy means that the factory will silently return null
when the first show-stopping obstacle occurs.
- Since:
- 0.4
- Author:
- Eirik Torske
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StrictReturnsNullFactory
public StrictReturnsNullFactory()
createObjectSpecifiedBy
public T createObjectSpecifiedBy(Specification specification)
- Specified by:
createObjectSpecifiedBy
in interface Factory
- Returns:
- an instance of type T, specified by given
Specification
; otherwise further events is based on factory implementation strategy
create
public T create(Specification specification)
- Description copied from interface:
Factory
- Alias of
createObjectSpecifiedBy()
.
- Specified by:
create
in interface Factory
Copyright © 2006-2010. All Rights Reserved.