Package javax.cache.configuration
Class FactoryBuilder
- java.lang.Object
-
- javax.cache.configuration.FactoryBuilder
-
public final class FactoryBuilder extends Object
A convenience class that defines generically typed static methods to aid in the building ofFactory
instances.Factory
is used byMutableConfiguration
to avoid adding non-Serializable instances that would assume usage in the local JVM.Two styles of builder are available:
Factory instances can also be created in other ways.- Since:
- 1.0
- Author:
- Brian Oliver, Greg Luck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FactoryBuilder.ClassFactory<T>
AFactory
that instantiates a specific Class.static class
FactoryBuilder.SingletonFactory<T>
AFactory
that always returns a specific instance.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Factory<T>
factoryOf(Class<T> clazz)
Constructs aFactory
that will produce factory instances of the specified class.static <T> Factory<T>
factoryOf(String className)
Constructs aFactory
that will produce factory instances of the specified class.static <T extends Serializable>
Factory<T>factoryOf(T instance)
Constructs aFactory
that will return the specified factory Serializable instance.
-
-
-
Method Detail
-
factoryOf
public static <T> Factory<T> factoryOf(Class<T> clazz)
Constructs aFactory
that will produce factory instances of the specified class.The specified class must have a no-args constructor.
-
factoryOf
public static <T> Factory<T> factoryOf(String className)
Constructs aFactory
that will produce factory instances of the specified class.The specified class must have a no-args constructor.
-
factoryOf
public static <T extends Serializable> Factory<T> factoryOf(T instance)
Constructs aFactory
that will return the specified factory Serializable instance.If T is not Serializable use
factoryOf(Class)
orfactoryOf(String)
.
-
-