All Downloads are FREE. Search and download functionalities are using the official Maven repository.

n.beanbuilder.beanbuilder-processor.1.0.0.source-code.BeanBuilder.tpl Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package ${ packageName };

!{for import : imports}
import ${ import };
!{/for}


/**
 * A Builder for {@link ${baseClassName}}.
 */
public class ${ builderClassName } {

!{for attribute : attributes}
    private ${attribute.shortTypeName} ${attribute.fieldName};
!{/for}


    /**
     * Hidden constructor.
     */
    private ${ builderClassName }() {

    }

    /**
     * Creates the instance.
     */
    public ${baseClassName} build() {

        ${baseClassName} returnValue = new ${baseClassName}();

!{for attribute : attributes}
        returnValue.set${attribute.getCCFieldName}( this.${attribute.fieldName} );
!{/for}

        return returnValue;

    }

!{for attribute : attributes}
    public ${ builderClassName } with${attribute.getCCFieldName} (${attribute.shortTypeName} value){
        this.${attribute.fieldName} = value;
        return this;
    }

!{/for}


    /**
     * Creates the builder instance.
     */
    public static ${ builderClassName } createBuilder () {
        return new ${ builderClassName }();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy