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

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


package com.alphasystem.docx4j.builder.wml;

import java.math.BigInteger;
import java.util.List;
import org.docx4j.wml.BooleanDefaultTrue;
import org.docx4j.wml.CTBorder;
import org.docx4j.wml.CTColumns;
import org.docx4j.wml.CTDecimalNumber;
import org.docx4j.wml.CTDocGrid;
import org.docx4j.wml.CTEdnProps;
import org.docx4j.wml.CTFtnProps;
import org.docx4j.wml.CTLineNumber;
import org.docx4j.wml.CTPageNumber;
import org.docx4j.wml.CTPaperSource;
import org.docx4j.wml.CTRel;
import org.docx4j.wml.CTSectPrChange;
import org.docx4j.wml.CTVerticalJc;
import org.docx4j.wml.STPageBorderDisplay;
import org.docx4j.wml.STPageBorderOffset;
import org.docx4j.wml.STPageBorderZOrder;
import org.docx4j.wml.STPageOrientation;
import org.docx4j.wml.STVerticalJc;
import org.docx4j.wml.SectPr;
import org.docx4j.wml.TextDirection;


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

    private SectPrBuilder.TypeBuilder typeBuilder;
    private SectPrBuilder.PgSzBuilder pgSzBuilder;
    private SectPrBuilder.PgMarBuilder pgMarBuilder;
    private SectPrBuilder.PgBordersBuilder pgBordersBuilder;

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

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public SectPrBuilder(SectPr object) {
        super(object);
        typeBuilder = new SectPrBuilder.TypeBuilder(this.object.getType());
        pgSzBuilder = new SectPrBuilder.PgSzBuilder(this.object.getPgSz());
        pgMarBuilder = new SectPrBuilder.PgMarBuilder(this.object.getPgMar());
        pgBordersBuilder = new SectPrBuilder.PgBordersBuilder(this.object.getPgBorders());
    }

    /**
     * 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 SectPrBuilder(SectPr src, SectPr target) {
        this(target);
        if (src!= null) {
            List egHdrFtrReferences = src.getEGHdrFtrReferences();
            for (CTRel o: egHdrFtrReferences) {
                addEGHdrFtrReferences(new com.alphasystem.docx4j.builder.wml.CTRelBuilder(o, null).getObject());
            }
            CTFtnProps footnotePr = src.getFootnotePr();
            if (footnotePr!= null) {
                footnotePr = new CTFtnPropsBuilder(footnotePr, object.getFootnotePr()).getObject();
            }
            CTEdnProps endnotePr = src.getEndnotePr();
            if (endnotePr!= null) {
                endnotePr = new CTEdnPropsBuilder(endnotePr, object.getEndnotePr()).getObject();
            }
            SectPr.Type type = src.getType();
            if (type!= null) {
                type = new SectPrBuilder.TypeBuilder(type, object.getType()).getObject();
            }
            SectPr.PgSz pgSz = src.getPgSz();
            if (pgSz!= null) {
                pgSz = new SectPrBuilder.PgSzBuilder(pgSz, object.getPgSz()).getObject();
            }
            SectPr.PgMar pgMar = src.getPgMar();
            if (pgMar!= null) {
                pgMar = new SectPrBuilder.PgMarBuilder(pgMar, object.getPgMar()).getObject();
            }
            CTPaperSource paperSrc = src.getPaperSrc();
            if (paperSrc!= null) {
                paperSrc = new CTPaperSourceBuilder(paperSrc, object.getPaperSrc()).getObject();
            }
            SectPr.PgBorders pgBorders = src.getPgBorders();
            if (pgBorders!= null) {
                pgBorders = new SectPrBuilder.PgBordersBuilder(pgBorders, object.getPgBorders()).getObject();
            }
            CTLineNumber lnNumType = src.getLnNumType();
            if (lnNumType!= null) {
                lnNumType = new CTLineNumberBuilder(lnNumType, object.getLnNumType()).getObject();
            }
            CTPageNumber pgNumType = src.getPgNumType();
            if (pgNumType!= null) {
                pgNumType = new CTPageNumberBuilder(pgNumType, object.getPgNumType()).getObject();
            }
            CTColumns cols = src.getCols();
            if (cols!= null) {
                cols = new CTColumnsBuilder(cols, object.getCols()).getObject();
            }
            CTVerticalJc vAlign = src.getVAlign();
            if (vAlign!= null) {
                vAlign = new com.alphasystem.docx4j.builder.wml.CTVerticalJcBuilder(vAlign, object.getVAlign()).getObject();
            }
            TextDirection textDirection = src.getTextDirection();
            if (textDirection!= null) {
                textDirection = new com.alphasystem.docx4j.builder.wml.TextDirectionBuilder(textDirection, object.getTextDirection()).getObject();
            }
            CTDocGrid docGrid = src.getDocGrid();
            if (docGrid!= null) {
                docGrid = new CTDocGridBuilder(docGrid, object.getDocGrid()).getObject();
            }
            CTRel printerSettings = src.getPrinterSettings();
            if (printerSettings!= null) {
                printerSettings = new com.alphasystem.docx4j.builder.wml.CTRelBuilder(printerSettings, object.getPrinterSettings()).getObject();
            }
            CTDecimalNumber footnoteColumns = src.getFootnoteColumns();
            if (footnoteColumns!= null) {
                footnoteColumns = new com.alphasystem.docx4j.builder.wml.CTDecimalNumberBuilder(footnoteColumns, object.getFootnoteColumns()).getObject();
            }
            CTSectPrChange sectPrChange = src.getSectPrChange();
            if (sectPrChange!= null) {
                sectPrChange = new CTSectPrChangeBuilder(sectPrChange, object.getSectPrChange()).getObject();
            }
            withFootnotePr(footnotePr).withEndnotePr(endnotePr).withType(type).withPgSz(pgSz).withPgMar(pgMar).withPaperSrc(paperSrc).withPgBorders(pgBorders).withLnNumType(lnNumType).withPgNumType(pgNumType).withCols(cols).withFormProt(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getFormProt())).withVAlign(vAlign).withNoEndnote(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getNoEndnote())).withTitlePg(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getTitlePg())).withTextDirection(textDirection).withBidi(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getBidi())).withRtlGutter(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getRtlGutter())).withDocGrid(docGrid).withPrinterSettings(printerSettings).withFootnoteColumns(footnoteColumns).withSectPrChange(sectPrChange).withRsidRPr(src.getRsidRPr()).withRsidDel(src.getRsidDel()).withRsidR(src.getRsidR()).withRsidSect(src.getRsidSect());
        }
    }

    protected SectPr createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createSectPr();
    }

    public SectPrBuilder addEGHdrFtrReferences(CTRel... value) {
        addContent(object.getEGHdrFtrReferences(), value);
        return this;
    }

    public SectPrBuilder addEGHdrFtrReferences(String... id) {
        if (hasContent(id)) {
            for (String o: id) {
                addEGHdrFtrReferences(new com.alphasystem.docx4j.builder.wml.CTRelBuilder().withId(o).getObject());
            }
        }
        return this;
    }

    public SectPrBuilder withFootnotePr(CTFtnProps value) {
        if (value!= null) {
            object.setFootnotePr(value);
        }
        return this;
    }

    public SectPrBuilder withEndnotePr(CTEdnProps value) {
        if (value!= null) {
            object.setEndnotePr(value);
        }
        return this;
    }

    public SectPrBuilder withType(SectPr.Type value) {
        if (value!= null) {
            object.setType(value);
        }
        return this;
    }

    public SectPrBuilder withType(String val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withType(typeBuilder.withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder.TypeBuilder getTypeBuilder() {
        return typeBuilder;
    }

    public SectPrBuilder withPgSz(SectPr.PgSz value) {
        if (value!= null) {
            object.setPgSz(value);
        }
        return this;
    }

    public SectPrBuilder withPgSz(Long w, Long h, STPageOrientation orient, Long code) {
        boolean initialized = ((((w!= null)||(h!= null))||(orient!= null))||(code!= null));
        if (initialized) {
            withPgSz(pgSzBuilder.withW(w).withH(h).withOrient(orient).withCode(code).getObject());
        }
        return this;
    }

    public SectPrBuilder.PgSzBuilder getPgSzBuilder() {
        return pgSzBuilder;
    }

    public SectPrBuilder withPgMar(SectPr.PgMar value) {
        if (value!= null) {
            object.setPgMar(value);
        }
        return this;
    }

    public SectPrBuilder.PgMarBuilder getPgMarBuilder() {
        return pgMarBuilder;
    }

    public SectPrBuilder withPaperSrc(CTPaperSource value) {
        if (value!= null) {
            object.setPaperSrc(value);
        }
        return this;
    }

    public SectPrBuilder withPgBorders(SectPr.PgBorders value) {
        if (value!= null) {
            object.setPgBorders(value);
        }
        return this;
    }

    public SectPrBuilder.PgBordersBuilder getPgBordersBuilder() {
        return pgBordersBuilder;
    }

    public SectPrBuilder withLnNumType(CTLineNumber value) {
        if (value!= null) {
            object.setLnNumType(value);
        }
        return this;
    }

    public SectPrBuilder withPgNumType(CTPageNumber value) {
        if (value!= null) {
            object.setPgNumType(value);
        }
        return this;
    }

    public SectPrBuilder withCols(CTColumns value) {
        if (value!= null) {
            object.setCols(value);
        }
        return this;
    }

    public SectPrBuilder withFormProt(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setFormProt(value);
        }
        return this;
    }

    public SectPrBuilder withFormProt(Boolean val) {
        if (val!= null) {
            object.setFormProt(new com.alphasystem.docx4j.builder.wml.BooleanDefaultTrueBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withVAlign(CTVerticalJc value) {
        if (value!= null) {
            object.setVAlign(value);
        }
        return this;
    }

    public SectPrBuilder withVAlign(STVerticalJc val) {
        if (val!= null) {
            object.setVAlign(new com.alphasystem.docx4j.builder.wml.CTVerticalJcBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withNoEndnote(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setNoEndnote(value);
        }
        return this;
    }

    public SectPrBuilder withNoEndnote(Boolean val) {
        if (val!= null) {
            object.setNoEndnote(new com.alphasystem.docx4j.builder.wml.BooleanDefaultTrueBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withTitlePg(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setTitlePg(value);
        }
        return this;
    }

    public SectPrBuilder withTitlePg(Boolean val) {
        if (val!= null) {
            object.setTitlePg(new com.alphasystem.docx4j.builder.wml.BooleanDefaultTrueBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withTextDirection(TextDirection value) {
        if (value!= null) {
            object.setTextDirection(value);
        }
        return this;
    }

    public SectPrBuilder withTextDirection(String val) {
        if (val!= null) {
            object.setTextDirection(new com.alphasystem.docx4j.builder.wml.TextDirectionBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withBidi(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setBidi(value);
        }
        return this;
    }

    public SectPrBuilder withBidi(Boolean val) {
        if (val!= null) {
            object.setBidi(new com.alphasystem.docx4j.builder.wml.BooleanDefaultTrueBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withRtlGutter(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setRtlGutter(value);
        }
        return this;
    }

    public SectPrBuilder withRtlGutter(Boolean val) {
        if (val!= null) {
            object.setRtlGutter(new com.alphasystem.docx4j.builder.wml.BooleanDefaultTrueBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withDocGrid(CTDocGrid value) {
        if (value!= null) {
            object.setDocGrid(value);
        }
        return this;
    }

    public SectPrBuilder withPrinterSettings(CTRel value) {
        if (value!= null) {
            object.setPrinterSettings(value);
        }
        return this;
    }

    public SectPrBuilder withPrinterSettings(String id) {
        if (id!= null) {
            object.setPrinterSettings(new com.alphasystem.docx4j.builder.wml.CTRelBuilder().withId(id).getObject());
        }
        return this;
    }

    public SectPrBuilder withFootnoteColumns(CTDecimalNumber value) {
        if (value!= null) {
            object.setFootnoteColumns(value);
        }
        return this;
    }

    public SectPrBuilder withFootnoteColumns(Long val) {
        if (val!= null) {
            object.setFootnoteColumns(new com.alphasystem.docx4j.builder.wml.CTDecimalNumberBuilder().withVal(val).getObject());
        }
        return this;
    }

    public SectPrBuilder withSectPrChange(CTSectPrChange value) {
        if (value!= null) {
            object.setSectPrChange(value);
        }
        return this;
    }

    public SectPrBuilder withRsidRPr(String value) {
        if (value!= null) {
            object.setRsidRPr(value);
        }
        return this;
    }

    public SectPrBuilder withRsidDel(String value) {
        if (value!= null) {
            object.setRsidDel(value);
        }
        return this;
    }

    public SectPrBuilder withRsidR(String value) {
        if (value!= null) {
            object.setRsidR(value);
        }
        return this;
    }

    public SectPrBuilder withRsidSect(String value) {
        if (value!= null) {
            object.setRsidSect(value);
        }
        return this;
    }


    /**
     * Fluent API builder for org.docx4j.wml.SectPr$PgBorders.
     * 
     */
    public static class PgBordersBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public PgBordersBuilder(SectPr.PgBorders 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 PgBordersBuilder(SectPr.PgBorders src, SectPr.PgBorders target) {
            this(target);
            if (src!= null) {
                CTBorder top = src.getTop();
                if (top!= null) {
                    top = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(top, object.getTop()).getObject();
                }
                CTBorder left = src.getLeft();
                if (left!= null) {
                    left = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(left, object.getLeft()).getObject();
                }
                CTBorder bottom = src.getBottom();
                if (bottom!= null) {
                    bottom = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(bottom, object.getBottom()).getObject();
                }
                CTBorder right = src.getRight();
                if (right!= null) {
                    right = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(right, object.getRight()).getObject();
                }
                withTop(top).withLeft(left).withBottom(bottom).withRight(right).withZOrder(src.getZOrder()).withDisplay(src.getDisplay()).withOffsetFrom(src.getOffsetFrom());
            }
        }

        protected SectPr.PgBorders createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createSectPrPgBorders();
        }

        public SectPrBuilder.PgBordersBuilder withTop(CTBorder value) {
            if (value!= null) {
                object.setTop(value);
            }
            return this;
        }

        public SectPrBuilder.PgBordersBuilder withLeft(CTBorder value) {
            if (value!= null) {
                object.setLeft(value);
            }
            return this;
        }

        public SectPrBuilder.PgBordersBuilder withBottom(CTBorder value) {
            if (value!= null) {
                object.setBottom(value);
            }
            return this;
        }

        public SectPrBuilder.PgBordersBuilder withRight(CTBorder value) {
            if (value!= null) {
                object.setRight(value);
            }
            return this;
        }

        public SectPrBuilder.PgBordersBuilder withZOrder(STPageBorderZOrder value) {
            if (value!= null) {
                object.setZOrder(value);
            }
            return this;
        }

        public SectPrBuilder.PgBordersBuilder withDisplay(STPageBorderDisplay value) {
            if (value!= null) {
                object.setDisplay(value);
            }
            return this;
        }

        public SectPrBuilder.PgBordersBuilder withOffsetFrom(STPageBorderOffset value) {
            if (value!= null) {
                object.setOffsetFrom(value);
            }
            return this;
        }

    }


    /**
     * Fluent API builder for org.docx4j.wml.SectPr$PgMar.
     * 
     */
    public static class PgMarBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public PgMarBuilder(SectPr.PgMar 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 PgMarBuilder(SectPr.PgMar src, SectPr.PgMar target) {
            this(target);
            if (src!= null) {
                withTop(WmlBuilderFactory.cloneBigInteger(src.getTop())).withRight(WmlBuilderFactory.cloneBigInteger(src.getRight())).withBottom(WmlBuilderFactory.cloneBigInteger(src.getBottom())).withLeft(WmlBuilderFactory.cloneBigInteger(src.getLeft())).withHeader(WmlBuilderFactory.cloneBigInteger(src.getHeader())).withFooter(WmlBuilderFactory.cloneBigInteger(src.getFooter())).withGutter(WmlBuilderFactory.cloneBigInteger(src.getGutter()));
            }
        }

        protected SectPr.PgMar createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createSectPrPgMar();
        }

        public SectPrBuilder.PgMarBuilder withTop(BigInteger value) {
            if (value!= null) {
                object.setTop(value);
            }
            return this;
        }

        /**
         * Calls setTop method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withTop(String value) {
            if (value!= null) {
                object.setTop(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setTop method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withTop(Long value) {
            if (value!= null) {
                object.setTop(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgMarBuilder withRight(BigInteger value) {
            if (value!= null) {
                object.setRight(value);
            }
            return this;
        }

        /**
         * Calls setRight method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withRight(String value) {
            if (value!= null) {
                object.setRight(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setRight method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withRight(Long value) {
            if (value!= null) {
                object.setRight(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgMarBuilder withBottom(BigInteger value) {
            if (value!= null) {
                object.setBottom(value);
            }
            return this;
        }

        /**
         * Calls setBottom method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withBottom(String value) {
            if (value!= null) {
                object.setBottom(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setBottom method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withBottom(Long value) {
            if (value!= null) {
                object.setBottom(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgMarBuilder withLeft(BigInteger value) {
            if (value!= null) {
                object.setLeft(value);
            }
            return this;
        }

        /**
         * Calls setLeft method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withLeft(String value) {
            if (value!= null) {
                object.setLeft(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setLeft method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withLeft(Long value) {
            if (value!= null) {
                object.setLeft(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgMarBuilder withHeader(BigInteger value) {
            if (value!= null) {
                object.setHeader(value);
            }
            return this;
        }

        /**
         * Calls setHeader method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withHeader(String value) {
            if (value!= null) {
                object.setHeader(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setHeader method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withHeader(Long value) {
            if (value!= null) {
                object.setHeader(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgMarBuilder withFooter(BigInteger value) {
            if (value!= null) {
                object.setFooter(value);
            }
            return this;
        }

        /**
         * Calls setFooter method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withFooter(String value) {
            if (value!= null) {
                object.setFooter(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setFooter method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withFooter(Long value) {
            if (value!= null) {
                object.setFooter(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgMarBuilder withGutter(BigInteger value) {
            if (value!= null) {
                object.setGutter(value);
            }
            return this;
        }

        /**
         * Calls setGutter method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withGutter(String value) {
            if (value!= null) {
                object.setGutter(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setGutter method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgMarBuilder withGutter(Long value) {
            if (value!= null) {
                object.setGutter(BigInteger.valueOf(value));
            }
            return this;
        }

    }


    /**
     * Fluent API builder for org.docx4j.wml.SectPr$PgSz.
     * 
     */
    public static class PgSzBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public PgSzBuilder(SectPr.PgSz 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 PgSzBuilder(SectPr.PgSz src, SectPr.PgSz target) {
            this(target);
            if (src!= null) {
                withW(WmlBuilderFactory.cloneBigInteger(src.getW())).withH(WmlBuilderFactory.cloneBigInteger(src.getH())).withOrient(src.getOrient()).withCode(WmlBuilderFactory.cloneBigInteger(src.getCode()));
            }
        }

        protected SectPr.PgSz createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createSectPrPgSz();
        }

        public SectPrBuilder.PgSzBuilder withW(BigInteger value) {
            if (value!= null) {
                object.setW(value);
            }
            return this;
        }

        /**
         * Calls setW method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgSzBuilder withW(String value) {
            if (value!= null) {
                object.setW(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setW method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgSzBuilder withW(Long value) {
            if (value!= null) {
                object.setW(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgSzBuilder withH(BigInteger value) {
            if (value!= null) {
                object.setH(value);
            }
            return this;
        }

        /**
         * Calls setH method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgSzBuilder withH(String value) {
            if (value!= null) {
                object.setH(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setH method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgSzBuilder withH(Long value) {
            if (value!= null) {
                object.setH(BigInteger.valueOf(value));
            }
            return this;
        }

        public SectPrBuilder.PgSzBuilder withOrient(STPageOrientation value) {
            if (value!= null) {
                object.setOrient(value);
            }
            return this;
        }

        public SectPrBuilder.PgSzBuilder withCode(BigInteger value) {
            if (value!= null) {
                object.setCode(value);
            }
            return this;
        }

        /**
         * Calls setCode method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgSzBuilder withCode(String value) {
            if (value!= null) {
                object.setCode(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setCode method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public SectPrBuilder.PgSzBuilder withCode(Long value) {
            if (value!= null) {
                object.setCode(BigInteger.valueOf(value));
            }
            return this;
        }

    }


    /**
     * Fluent API builder for org.docx4j.wml.SectPr$Type.
     * 
     */
    public static class TypeBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public TypeBuilder(SectPr.Type 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 TypeBuilder(SectPr.Type src, SectPr.Type target) {
            this(target);
            if (src!= null) {
                withVal(src.getVal());
            }
        }

        protected SectPr.Type createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createSectPrType();
        }

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

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy