public interface TransformFactory
Transform
implementations can be installed in the
TransformFactory
to be instantiated when needed. The transforms
are ordered in a graph-like manner so that all tranforms leading away from
a particular model type easily can be located.Modifier and Type | Method and Description |
---|---|
<A,T extends Transform<A,?>> |
allFrom(Class<A> from)
Builds a stream of all transforms that match the specified model.
|
static <T> T |
create(Class<T> clazz)
Instantiates the specified class and returns it.
|
String |
getName()
Returns a unique name of this factory.
|
<A,B,T extends Transform<A,B>> |
install(Class<A> from,
Class<B> to,
Class<T> transformer)
Installs the specified
Transform . |
default <A,T extends Transform<A,String>> |
install(Class<A> from,
Class<T> transformer)
Installs the specified
Transform , assuming that the resulting
class is a String. |
String getName()
default <A,T extends Transform<A,String>> TransformFactory install(Class<A> from, Class<T> transformer)
Transform
, assuming that the resulting
class is a String.A
- the type to transform fromT
- the transformerfrom
- the modeltransformer
- the view<A,B,T extends Transform<A,B>> TransformFactory install(Class<A> from, Class<B> to, Class<T> transformer)
Transform
.A
- the type to transform fromB
- the type to transform toT
- the transformerfrom
- the model class to transform fromto
- the model class to transform totransformer
- the view<A,T extends Transform<A,?>> Set<Map.Entry<Class<?>,T>> allFrom(Class<A> from)
A
- the class to transform fromT
- the transformerfrom
- the model class to transform fromstatic <T> T create(Class<T> clazz)
T
- the return typeclazz
- a class of the intended return typeCopyright © 2016 Speedment, Inc.. All rights reserved.