Package javax.cache.configuration
Class FactoryBuilder
- java.lang.Object
-
- javax.cache.configuration.FactoryBuilder
-
public final class FactoryBuilder extends java.lang.ObjectA convenience class that defines generically typed static methods to aid in the building ofFactoryinstances.Factoryis used byMutableConfigurationto 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFactoryBuilder.ClassFactory<T>AFactorythat instantiates a specific Class.static classFactoryBuilder.SingletonFactory<T>AFactorythat always returns a specific instance.
-
Constructor Summary
Constructors Modifier Constructor Description privateFactoryBuilder()A private constructor to prevent instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Factory<T>factoryOf(java.lang.Class<T> clazz)Constructs aFactorythat will produce factory instances of the specified class.static <T> Factory<T>factoryOf(java.lang.String className)Constructs aFactorythat will produce factory instances of the specified class.static <T extends java.io.Serializable>
Factory<T>factoryOf(T instance)Constructs aFactorythat will return the specified factory Serializable instance.
-
-
-
Method Detail
-
factoryOf
public static <T> Factory<T> factoryOf(java.lang.Class<T> clazz)
Constructs aFactorythat will produce factory instances of the specified class.The specified class must have a no-args constructor.
-
factoryOf
public static <T> Factory<T> factoryOf(java.lang.String className)
Constructs aFactorythat will produce factory instances of the specified class.The specified class must have a no-args constructor.
-
factoryOf
public static <T extends java.io.Serializable> Factory<T> factoryOf(T instance)
Constructs aFactorythat will return the specified factory Serializable instance.If T is not Serializable use
factoryOf(Class)orfactoryOf(String).
-
-