jklustor-all-api-0.0.7-20140619012755 (ChemAxon)

Annotation Type BuilderClass

public @interface BuilderClass

This annotation gives information about the associated ParameterBuilder for this class.

It is expected that the referenced ParameterBuilder should have a nullary constructor for the default values and a copy constructor with an argument of the built class.

Usually immutable parameter classes have associated builder classes. To allow easy reflection based management (API discovery, persistence, etc) it is desirable to have a "mutable version" of this object. Builder pattern helps to provide easy to use type safe creation for such immutable objects. The reflection based approaches usually needs "reverse builder" functionality: to create a mutable version from the immutable. An elegant way is to provide an association to the builder class and provide a copy constructor

Usually a public nullary constructor of the built class should be provided which initializes deafult values.

Please note that this annotation is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.

Gabor Imre

Required Element Summary
 Class<? extends ParameterBuilder<?>> builderClass
          Associated builder class for this immutable object.

Element Detail


public abstract Class<? extends ParameterBuilder<?>> builderClass
Associated builder class for this immutable object.

The referenced builder class is expected to have a single argument constructor which is an instance of the annotated (immutable, built) class. This constructor is expected to initialize the builder based on the passed reference

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)