Annotation Interface StaticFactories
Generate a static factory method for each public constructor of the annotated class.
Example
@StaticFactories("Foo")
public final class FactoryFoo
{
public FactoryFoo(@Nonnull final String s)
{
this(s, 0);
}
public FactoryFoo(@Nonnull final String s, int i)
{
}
}
generates
public final class Foo {
private Foo() {
// no-instances constructor
}
public static FactoryFoo factoryFoo(@Nonnull final String s) {
return new FactoryFoo(s);
}
public static FactoryFoo factoryFoo(@Nonnull final String s, int i) {
return new FactoryFoo(s,i);
}
}
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name of the package where to put the class containing the static factory methods.
-
Element Details
-
value
String valueThe name of the class containing the static factory methods.
-
-
-
packageName
String packageNameThe name of the package where to put the class containing the static factory methods.By default, the class will be created in the same package as the annotated class.
- Default:
- ""
-