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

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

There is a newer version: 0.5.5
Show newest version

package com.alphasystem.docx4j.builder.wml;

import java.math.BigInteger;
import org.docx4j.wml.Lvl;


/**
 * Fluent API builder for org.docx4j.wml.Numbering$Num$LvlOverride.
 * 
 */
public class NumberingNumLvlOverrideBuilder
    extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{

    private NumberingNumLvlOverrideBuilder.StartOverrideBuilder startOverrideBuilder;

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

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public NumberingNumLvlOverrideBuilder(org.docx4j.wml.Numbering.Num.LvlOverride object) {
        super(object);
        startOverrideBuilder = new NumberingNumLvlOverrideBuilder.StartOverrideBuilder(this.object.getStartOverride());
    }

    /**
     * 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 NumberingNumLvlOverrideBuilder(org.docx4j.wml.Numbering.Num.LvlOverride src, org.docx4j.wml.Numbering.Num.LvlOverride target) {
        this(target);
        if (src!= null) {
            org.docx4j.wml.Numbering.Num.LvlOverride.StartOverride startOverride = src.getStartOverride();
            if (startOverride!= null) {
                startOverride = new NumberingNumLvlOverrideBuilder.StartOverrideBuilder(startOverride, object.getStartOverride()).getObject();
            }
            Lvl lvl = src.getLvl();
            if (lvl!= null) {
                lvl = new LvlBuilder(lvl, object.getLvl()).getObject();
            }
            withStartOverride(startOverride).withLvl(lvl).withIlvl(WmlBuilderFactory.cloneBigInteger(src.getIlvl()));
        }
    }

    protected org.docx4j.wml.Numbering.Num.LvlOverride createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createNumberingNumLvlOverride();
    }

    public NumberingNumLvlOverrideBuilder withStartOverride(org.docx4j.wml.Numbering.Num.LvlOverride.StartOverride value) {
        if (value!= null) {
            object.setStartOverride(value);
        }
        return this;
    }

    public NumberingNumLvlOverrideBuilder withStartOverride(Long val) {
        boolean initialized = (val!= null);
        if (initialized) {
            withStartOverride(startOverrideBuilder.withVal(val).getObject());
        }
        return this;
    }

    public NumberingNumLvlOverrideBuilder.StartOverrideBuilder getStartOverrideBuilder() {
        return startOverrideBuilder;
    }

    public NumberingNumLvlOverrideBuilder withLvl(Lvl value) {
        if (value!= null) {
            object.setLvl(value);
        }
        return this;
    }

    public NumberingNumLvlOverrideBuilder withIlvl(BigInteger value) {
        if (value!= null) {
            object.setIlvl(value);
        }
        return this;
    }

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

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


    /**
     * Fluent API builder for org.docx4j.wml.Numbering$Num$LvlOverride$StartOverride.
     * 
     */
    public static class StartOverrideBuilder
        extends com.alphasystem.docx4j.builder.OpenXmlBuilder
    {


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

        /**
         * Initialize the builder with given object.
         * 
         * @param object
         *     the given object
         */
        public StartOverrideBuilder(org.docx4j.wml.Numbering.Num.LvlOverride.StartOverride 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 StartOverrideBuilder(org.docx4j.wml.Numbering.Num.LvlOverride.StartOverride src, org.docx4j.wml.Numbering.Num.LvlOverride.StartOverride target) {
            this(target);
            if (src!= null) {
                withVal(WmlBuilderFactory.cloneBigInteger(src.getVal()));
            }
        }

        protected org.docx4j.wml.Numbering.Num.LvlOverride.StartOverride createObject() {
            return WmlBuilderFactory.OBJECT_FACTORY.createNumberingNumLvlOverrideStartOverride();
        }

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

        /**
         * Calls setVal method.
         * 
         * @param value
         *     Value to set
         * @return
         *     reference to this
         */
        public NumberingNumLvlOverrideBuilder.StartOverrideBuilder 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 NumberingNumLvlOverrideBuilder.StartOverrideBuilder withVal(Long value) {
            if (value!= null) {
                object.setVal(BigInteger.valueOf(value));
            }
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy