Factory instances.
Factory is used by MutableConfiguration 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.| Modifier and Type | Class and Description |
|---|---|
| public static class | FactoryBuilder.ClassFactory<
the type of the instance produced by the T>FactoryA |
| public static class | FactoryBuilder.SingletonFactory<
the type of the instance produced by the T>FactoryA |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of the instances produced by the T> FactoryFactory | |
| public static < the type of the instances produced by the T> FactoryFactory | |
| public static < the type of the instances returned T extends Serializable> Factory |
| FactoryBuilder | back to summary |
|---|---|
| private FactoryBuilder() A private constructor to prevent instantiation. | |
| factoryOf | back to summary |
|---|---|
| public static <T> Factory Constructs a The specified class must have a no-args constructor. | |
| factoryOf | back to summary |
|---|---|
| public static <T> Factory Constructs a The specified class must have a no-args constructor. | |
| factoryOf | back to summary |
|---|---|
| public static <T extends Serializable> Factory Constructs a
If T is not Serializable use | |
Factory
Factory that instantiates a specific Class.
| Modifier and Type | Field and Description |
|---|---|
| private String | className
The name of the Class. |
| public static final long | serialVersionUID
The serialVersionUID required for |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public T | create()
Implements javax. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public int |
| className | back to summary |
|---|---|
| private String className The name of the Class. | |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID The serialVersionUID required for | |
| ClassFactory | back to summary |
|---|---|
| public ClassFactory(Class<T> clazz) Constructor for the
| |
| ClassFactory | back to summary |
|---|---|
| public ClassFactory(String className) Constructor for the
| |
| create | back to summary |
|---|---|
| public T create() Implements javax. Doc from javax. Constructs and returns a fully configured instance of T.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
Factory
Factory that always returns a specific instance. ie: the
factory returns a singleton, regardless of the number of times
Factory#create() is called.
| Modifier and Type | Field and Description |
|---|---|
| private T | instance
The singleton instance. |
| public static final long | serialVersionUID
The serialVersionUID required for |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public T | create()
Implements javax. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public int |
| instance | back to summary |
|---|---|
| private T instance The singleton instance. | |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID The serialVersionUID required for | |
| SingletonFactory | back to summary |
|---|---|
| public SingletonFactory(T instance) Constructor for the
| |
| create | back to summary |
|---|---|
| public T create() Implements javax. Doc from javax. Constructs and returns a fully configured instance of T.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |