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

com.alphasystem.docx4j.builder.wml.CTSdtDocPartBuilder Maven / Gradle / Ivy

There is a newer version: 0.5.5
Show newest version

package com.alphasystem.docx4j.builder.wml;

import org.docx4j.wml.BooleanDefaultTrue;
import org.docx4j.wml.CTSdtDocPart;


/**
 * Fluent API builder for org.docx4j.wml.CTSdtDocPart.
 * 
 */
public class CTSdtDocPartBuilder
    extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{

    private CTSdtDocPartBuilder.DocPartGalleryBuilder docPartGalleryBuilder;
    private CTSdtDocPartBuilder.DocPartCategoryBuilder docPartCategoryBuilder;

    /**
     * Initialize the underlying object.
     * 
     */
    public CTSdtDocPartBuilder() {
        this(null);
    }

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public CTSdtDocPartBuilder(CTSdtDocPart object) {
        super(object);
        docPartGalleryBuilder = new CTSdtDocPartBuilder.DocPartGalleryBuilder(this.object.getDocPartGallery());
        docPartCategoryBuilder = new CTSdtDocPartBuilder.DocPartCategoryBuilder(this.object.getDocPartCategory());
    }

    /**
     * Copies values fom src into target. Values of target will be overridden by the values from src.
     * 
     * @param src
     *     source object
     * @param target
     *     target object
     */
    public CTSdtDocPartBuilder(CTSdtDocPart src, CTSdtDocPart target) {
        this(target);
        if (src!= null) {
            CTSdtDocPart.DocPartGallery docPartGallery = src.getDocPartGallery();
            if (docPartGallery!= null) {
                docPartGallery = new CTSdtDocPartBuilder.DocPartGalleryBuilder(docPartGallery, object.getDocPartGallery()).getObject();
            }
            CTSdtDocPart.DocPartCategory docPartCategory = src.getDocPartCategory();
            if (docPartCategory!= null) {
                docPartCategory = new CTSdtDocPartBuilder.DocPartCategoryBuilder(docPartCategory, object.getDocPartCategory()).getObject();
            }
            withDocPartGallery(docPartGallery).withDocPartCategory(docPartCategory).withDocPartUnique(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getDocPartUnique()));
        }
    }

    protected CTSdtDocPart createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createCTSdtDocPart();
    }

    public CTSdtDocPartBuilder withDocPartGallery(CTSdtDocPart.DocPartGallery value) {
        if (value!= null) {
            object.setDocPartGallery(value);
        }
        return this;
    }

    public CTSdtDocPartBuilder withDocPartGallery(String val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withDocPartGallery(docPartGalleryBuilder.withVal(val).getObject());
        }
        return this;
    }

    public CTSdtDocPartBuilder.DocPartGalleryBuilder getDocPartGalleryBuilder() {
        return docPartGalleryBuilder;
    }

    public CTSdtDocPartBuilder withDocPartCategory(CTSdtDocPart.DocPartCategory value) {
        if (value!= null) {
            object.setDocPartCategory(value);
        }
        return this;
    }

    public CTSdtDocPartBuilder withDocPartCategory(String val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withDocPartCategory(docPartCategoryBuilder.withVal(val).getObject());
        }
        return this;
    }

    public CTSdtDocPartBuilder.DocPartCategoryBuilder getDocPartCategoryBuilder() {
        return docPartCategoryBuilder;
    }

    public CTSdtDocPartBuilder withDocPartUnique(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setDocPartUnique(value);
        }
        return this;
    }

    public CTSdtDocPartBuilder withDocPartUnique(Boolean val) {
        if (val!= null) {
            object.setDocPartUnique(new BooleanDefaultTrueBuilder().withVal(val).getObject());
        }
        return this;
    }


    /**
     * Fluent API builder for org.docx4j.wml.CTSdtDocPart$DocPartCategory.
     * 
     */
    public static class DocPartCategoryBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


        /**
         * Initialize the underlying object.
         * 
         */
        public DocPartCategoryBuilder() {
            this(null);
        }

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public DocPartCategoryBuilder(CTSdtDocPart.DocPartCategory object) {
            super(object);
        }

        /**
         * Copies values fom src into target. Values of target will be overridden by the values from src.
         * 
         * @param src
         *     source object
         * @param target
         *     target object
         */
        public DocPartCategoryBuilder(CTSdtDocPart.DocPartCategory src, CTSdtDocPart.DocPartCategory target) {
            this(target);
            if (src!= null) {
                withVal(src.getVal());
            }
        }

        protected CTSdtDocPart.DocPartCategory createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createCTSdtDocPartDocPartCategory();
        }

        public CTSdtDocPartBuilder.DocPartCategoryBuilder withVal(String value) {
            if (value!= null) {
                object.setVal(value);
            }
            return this;
        }

    }


    /**
     * Fluent API builder for org.docx4j.wml.CTSdtDocPart$DocPartGallery.
     * 
     */
    public static class DocPartGalleryBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


        /**
         * Initialize the underlying object.
         * 
         */
        public DocPartGalleryBuilder() {
            this(null);
        }

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public DocPartGalleryBuilder(CTSdtDocPart.DocPartGallery object) {
            super(object);
        }

        /**
         * Copies values fom src into target. Values of target will be overridden by the values from src.
         * 
         * @param src
         *     source object
         * @param target
         *     target object
         */
        public DocPartGalleryBuilder(CTSdtDocPart.DocPartGallery src, CTSdtDocPart.DocPartGallery target) {
            this(target);
            if (src!= null) {
                withVal(src.getVal());
            }
        }

        protected CTSdtDocPart.DocPartGallery createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createCTSdtDocPartDocPartGallery();
        }

        public CTSdtDocPartBuilder.DocPartGalleryBuilder withVal(String value) {
            if (value!= null) {
                object.setVal(value);
            }
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy