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

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


package com.alphasystem.docx4j.builder.wml;

import java.math.BigInteger;
import org.docx4j.wml.BooleanDefaultTrue;
import org.docx4j.wml.CTBorder;
import org.docx4j.wml.CTCellMergeTrackChange;
import org.docx4j.wml.CTCnf;
import org.docx4j.wml.CTShd;
import org.docx4j.wml.CTTrackChange;
import org.docx4j.wml.CTVerticalJc;
import org.docx4j.wml.STVerticalJc;
import org.docx4j.wml.TblWidth;
import org.docx4j.wml.TcMar;
import org.docx4j.wml.TcPrInner;
import org.docx4j.wml.TextDirection;


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

    private TcPrInnerBuilder.GridSpanBuilder gridSpanBuilder;
    private TcPrInnerBuilder.HMergeBuilder hMergeBuilder;
    private TcPrInnerBuilder.VMergeBuilder vMergeBuilder;
    private TcPrInnerBuilder.TcBordersBuilder tcBordersBuilder;

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

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public TcPrInnerBuilder(TcPrInner object) {
        super(object);
        gridSpanBuilder = new TcPrInnerBuilder.GridSpanBuilder(this.object.getGridSpan());
        hMergeBuilder = new TcPrInnerBuilder.HMergeBuilder(this.object.getHMerge());
        vMergeBuilder = new TcPrInnerBuilder.VMergeBuilder(this.object.getVMerge());
        tcBordersBuilder = new TcPrInnerBuilder.TcBordersBuilder(this.object.getTcBorders());
    }

    /**
     * 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 TcPrInnerBuilder(TcPrInner src, TcPrInner target) {
        this(target);
        if (src!= null) {
            CTCnf cnfStyle = src.getCnfStyle();
            if (cnfStyle!= null) {
                cnfStyle = new com.alphasystem.docx4j.builder.wml.CTCnfBuilder(cnfStyle, object.getCnfStyle()).getObject();
            }
            TblWidth tcW = src.getTcW();
            if (tcW!= null) {
                tcW = new TblWidthBuilder(tcW, object.getTcW()).getObject();
            }
            TcPrInner.GridSpan gridSpan = src.getGridSpan();
            if (gridSpan!= null) {
                gridSpan = new TcPrInnerBuilder.GridSpanBuilder(gridSpan, object.getGridSpan()).getObject();
            }
            TcPrInner.HMerge hMerge = src.getHMerge();
            if (hMerge!= null) {
                hMerge = new TcPrInnerBuilder.HMergeBuilder(hMerge, object.getHMerge()).getObject();
            }
            TcPrInner.VMerge vMerge = src.getVMerge();
            if (vMerge!= null) {
                vMerge = new TcPrInnerBuilder.VMergeBuilder(vMerge, object.getVMerge()).getObject();
            }
            TcPrInner.TcBorders tcBorders = src.getTcBorders();
            if (tcBorders!= null) {
                tcBorders = new TcPrInnerBuilder.TcBordersBuilder(tcBorders, object.getTcBorders()).getObject();
            }
            CTShd shd = src.getShd();
            if (shd!= null) {
                shd = new CTShdBuilder(shd, object.getShd()).getObject();
            }
            TcMar tcMar = src.getTcMar();
            if (tcMar!= null) {
                tcMar = new TcMarBuilder(tcMar, object.getTcMar()).getObject();
            }
            TextDirection textDirection = src.getTextDirection();
            if (textDirection!= null) {
                textDirection = new com.alphasystem.docx4j.builder.wml.TextDirectionBuilder(textDirection, object.getTextDirection()).getObject();
            }
            CTVerticalJc vAlign = src.getVAlign();
            if (vAlign!= null) {
                vAlign = new com.alphasystem.docx4j.builder.wml.CTVerticalJcBuilder(vAlign, object.getVAlign()).getObject();
            }
            CTTrackChange cellIns = src.getCellIns();
            if (cellIns!= null) {
                cellIns = new com.alphasystem.docx4j.builder.wml.CTTrackChangeBuilder(cellIns, object.getCellIns()).getObject();
            }
            CTTrackChange cellDel = src.getCellDel();
            if (cellDel!= null) {
                cellDel = new com.alphasystem.docx4j.builder.wml.CTTrackChangeBuilder(cellDel, object.getCellDel()).getObject();
            }
            CTCellMergeTrackChange cellMerge = src.getCellMerge();
            if (cellMerge!= null) {
                cellMerge = new CTCellMergeTrackChangeBuilder(cellMerge, object.getCellMerge()).getObject();
            }
            withCnfStyle(cnfStyle).withTcW(tcW).withGridSpan(gridSpan).withHMerge(hMerge).withVMerge(vMerge).withTcBorders(tcBorders).withShd(shd).withNoWrap(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getNoWrap())).withTcMar(tcMar).withTextDirection(textDirection).withTcFitText(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getTcFitText())).withVAlign(vAlign).withHideMark(WmlBuilderFactory.cloneBooleanDefaultTrue(src.getHideMark())).withCellIns(cellIns).withCellDel(cellDel).withCellMerge(cellMerge);
        }
    }

    protected TcPrInner createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createTcPrInner();
    }

    public TcPrInnerBuilder withCnfStyle(CTCnf value) {
        if (value!= null) {
            object.setCnfStyle(value);
        }
        return this;
    }

    public TcPrInnerBuilder withCnfStyle(String val) {
        if (val!= null) {
            object.setCnfStyle(new com.alphasystem.docx4j.builder.wml.CTCnfBuilder().withVal(val).getObject());
        }
        return this;
    }

    public TcPrInnerBuilder withTcW(TblWidth value) {
        if (value!= null) {
            object.setTcW(value);
        }
        return this;
    }

    public TcPrInnerBuilder withGridSpan(TcPrInner.GridSpan value) {
        if (value!= null) {
            object.setGridSpan(value);
        }
        return this;
    }

    public TcPrInnerBuilder withGridSpan(Long val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withGridSpan(gridSpanBuilder.withVal(val).getObject());
        }
        return this;
    }

    public TcPrInnerBuilder.GridSpanBuilder getGridSpanBuilder() {
        return gridSpanBuilder;
    }

    public TcPrInnerBuilder withHMerge(TcPrInner.HMerge value) {
        if (value!= null) {
            object.setHMerge(value);
        }
        return this;
    }

    public TcPrInnerBuilder withHMerge(String val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withHMerge(hMergeBuilder.withVal(val).getObject());
        }
        return this;
    }

    public TcPrInnerBuilder.HMergeBuilder getHMergeBuilder() {
        return hMergeBuilder;
    }

    public TcPrInnerBuilder withVMerge(TcPrInner.VMerge value) {
        if (value!= null) {
            object.setVMerge(value);
        }
        return this;
    }

    public TcPrInnerBuilder withVMerge(String val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withVMerge(vMergeBuilder.withVal(val).getObject());
        }
        return this;
    }

    public TcPrInnerBuilder.VMergeBuilder getVMergeBuilder() {
        return vMergeBuilder;
    }

    public TcPrInnerBuilder withTcBorders(TcPrInner.TcBorders value) {
        if (value!= null) {
            object.setTcBorders(value);
        }
        return this;
    }

    public TcPrInnerBuilder.TcBordersBuilder getTcBordersBuilder() {
        return tcBordersBuilder;
    }

    public TcPrInnerBuilder withShd(CTShd value) {
        if (value!= null) {
            object.setShd(value);
        }
        return this;
    }

    public TcPrInnerBuilder withNoWrap(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setNoWrap(value);
        }
        return this;
    }

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

    public TcPrInnerBuilder withTcMar(TcMar value) {
        if (value!= null) {
            object.setTcMar(value);
        }
        return this;
    }

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

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

    public TcPrInnerBuilder withTcFitText(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setTcFitText(value);
        }
        return this;
    }

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

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

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

    public TcPrInnerBuilder withHideMark(BooleanDefaultTrue value) {
        if (value!= null) {
            object.setHideMark(value);
        }
        return this;
    }

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

    public TcPrInnerBuilder withCellIns(CTTrackChange value) {
        if (value!= null) {
            object.setCellIns(value);
        }
        return this;
    }

    public TcPrInnerBuilder withCellDel(CTTrackChange value) {
        if (value!= null) {
            object.setCellDel(value);
        }
        return this;
    }

    public TcPrInnerBuilder withCellMerge(CTCellMergeTrackChange value) {
        if (value!= null) {
            object.setCellMerge(value);
        }
        return this;
    }


    /**
     * Fluent API builder for org.docx4j.wml.TcPrInner$GridSpan.
     * 
     */
    public static class GridSpanBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

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

        protected TcPrInner.GridSpan createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createTcPrInnerGridSpan();
        }

        public TcPrInnerBuilder.GridSpanBuilder withVal(BigInteger value) {
            if (value!= null) {
                object.setVal(value);
            }
            return this;
        }

        /**
         * Calls setVal method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public TcPrInnerBuilder.GridSpanBuilder withVal(String value) {
            if (value!= null) {
                object.setVal(new BigInteger(value));
            }
            return this;
        }

        /**
         * Calls setVal method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public TcPrInnerBuilder.GridSpanBuilder withVal(Long value) {
            if (value!= null) {
                object.setVal(BigInteger.valueOf(value));
            }
            return this;
        }

    }


    /**
     * Fluent API builder for org.docx4j.wml.TcPrInner$HMerge.
     * 
     */
    public static class HMergeBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

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

        protected TcPrInner.HMerge createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createTcPrInnerHMerge();
        }

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

    }


    /**
     * Fluent API builder for org.docx4j.wml.TcPrInner$TcBorders.
     * 
     */
    public static class TcBordersBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public TcBordersBuilder(TcPrInner.TcBorders 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 TcBordersBuilder(TcPrInner.TcBorders src, TcPrInner.TcBorders 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();
                }
                CTBorder insideH = src.getInsideH();
                if (insideH!= null) {
                    insideH = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(insideH, object.getInsideH()).getObject();
                }
                CTBorder insideV = src.getInsideV();
                if (insideV!= null) {
                    insideV = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(insideV, object.getInsideV()).getObject();
                }
                CTBorder tl2Br = src.getTl2Br();
                if (tl2Br!= null) {
                    tl2Br = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(tl2Br, object.getTl2Br()).getObject();
                }
                CTBorder tr2Bl = src.getTr2Bl();
                if (tr2Bl!= null) {
                    tr2Bl = new com.alphasystem.docx4j.builder.wml.CTBorderBuilder(tr2Bl, object.getTr2Bl()).getObject();
                }
                withTop(top).withLeft(left).withBottom(bottom).withRight(right).withInsideH(insideH).withInsideV(insideV).withTl2Br(tl2Br).withTr2Bl(tr2Bl);
            }
        }

        protected TcPrInner.TcBorders createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createTcPrInnerTcBorders();
        }

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

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

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

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

        public TcPrInnerBuilder.TcBordersBuilder withInsideH(CTBorder value) {
            if (value!= null) {
                object.setInsideH(value);
            }
            return this;
        }

        public TcPrInnerBuilder.TcBordersBuilder withInsideV(CTBorder value) {
            if (value!= null) {
                object.setInsideV(value);
            }
            return this;
        }

        public TcPrInnerBuilder.TcBordersBuilder withTl2Br(CTBorder value) {
            if (value!= null) {
                object.setTl2Br(value);
            }
            return this;
        }

        public TcPrInnerBuilder.TcBordersBuilder withTr2Bl(CTBorder value) {
            if (value!= null) {
                object.setTr2Bl(value);
            }
            return this;
        }

    }


    /**
     * Fluent API builder for org.docx4j.wml.TcPrInner$VMerge.
     * 
     */
    public static class VMergeBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

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

        protected TcPrInner.VMerge createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createTcPrInnerVMerge();
        }

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

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy