|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.natpryce.makeiteasy.Maker<T>
T - the type of object to makepublic class Maker<T>
Makes objects of a given type with a specified initial state.
| Constructor Summary | |
|---|---|
Maker(Instantiator<T> instantiator,
PropertyValue<? super T,?>... propertyValues)
Creates a Maker for objects of a given type with a given initial state. |
|
| Method Summary | ||
|---|---|---|
Maker<T> |
but(PropertyValue<? super T,?>... propertyValues)
Returns a new Maker for the same type of object and with the same initial state except where overridden by the given propertyValues. |
|
T |
make()
Makes a new object. |
|
T |
value()
Donate the value. |
|
|
valueOf(Property<? super T,V> property,
Donor<? extends V> defaultValue)
|
|
|
valueOf(Property<? super T,V> property,
V defaultValue)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Maker(Instantiator<T> instantiator,
PropertyValue<? super T,?>... propertyValues)
instantiator - creates the new objectspropertyValues - define the initial state of the new objects| Method Detail |
|---|
public T make()
MakeItEasy.make method
is syntactic sugar to make calls to this method read more naturally in most
contexts.
public T value()
Donor
value in interface Donor<T>public Maker<T> but(PropertyValue<? super T,?>... propertyValues)
propertyValues - those initial properties of the new Make that will differ from this Maker
public <V> V valueOf(Property<? super T,V> property,
V defaultValue)
valueOf in interface PropertyLookup<T>V - the type of the valueproperty - the property for which a value will be returneddefaultValue - the default value to use if no value can be found
public <V> V valueOf(Property<? super T,V> property,
Donor<? extends V> defaultValue)
valueOf in interface PropertyLookup<T>V - the type of the valueproperty - the property for which a value will be returneddefaultValue - an object that can provide the default value to use if no value can be found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||