com.alphasystem.docx4j.builder.wml.CTEdnPropsBuilder Maven / Gradle / Ivy
package com.alphasystem.docx4j.builder.wml;
import java.math.BigInteger;
import org.docx4j.wml.CTEdnPos;
import org.docx4j.wml.CTEdnProps;
import org.docx4j.wml.CTNumRestart;
import org.docx4j.wml.NumFmt;
import org.docx4j.wml.NumberFormat;
import org.docx4j.wml.STEdnPos;
import org.docx4j.wml.STRestartNumber;
/**
* Fluent API builder for org.docx4j.wml.CTEdnProps
.
*
*/
public class CTEdnPropsBuilder
extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{
private CTEdnPropsBuilder.NumStartBuilder numStartBuilder;
/**
* Initialize the underlying object.
*
*/
public CTEdnPropsBuilder() {
this(null);
}
/**
* Initialize the builder with given object.
*
* @param object
* the given object
*/
public CTEdnPropsBuilder(CTEdnProps object) {
super(object);
numStartBuilder = new CTEdnPropsBuilder.NumStartBuilder(this.object.getNumStart());
}
/**
* 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 CTEdnPropsBuilder(CTEdnProps src, CTEdnProps target) {
this(target);
if (src!= null) {
CTEdnPos pos = src.getPos();
if (pos!= null) {
pos = new com.alphasystem.docx4j.builder.wml.CTEdnPosBuilder(pos, object.getPos()).getObject();
}
NumFmt numFmt = src.getNumFmt();
if (numFmt!= null) {
numFmt = new com.alphasystem.docx4j.builder.wml.NumFmtBuilder(numFmt, object.getNumFmt()).getObject();
}
CTEdnProps.NumStart numStart = src.getNumStart();
if (numStart!= null) {
numStart = new CTEdnPropsBuilder.NumStartBuilder(numStart, object.getNumStart()).getObject();
}
CTNumRestart numRestart = src.getNumRestart();
if (numRestart!= null) {
numRestart = new com.alphasystem.docx4j.builder.wml.CTNumRestartBuilder(numRestart, object.getNumRestart()).getObject();
}
withPos(pos).withNumFmt(numFmt).withNumStart(numStart).withNumRestart(numRestart);
}
}
protected CTEdnProps createObject() {
return WmlBuilderFactory.OBJECT_FACTORY.createCTEdnProps();
}
public CTEdnPropsBuilder withPos(CTEdnPos value) {
if (value!= null) {
object.setPos(value);
}
return this;
}
public CTEdnPropsBuilder withPos(STEdnPos val) {
if (val!= null) {
object.setPos(new com.alphasystem.docx4j.builder.wml.CTEdnPosBuilder().withVal(val).getObject());
}
return this;
}
public CTEdnPropsBuilder withNumFmt(NumFmt value) {
if (value!= null) {
object.setNumFmt(value);
}
return this;
}
public CTEdnPropsBuilder withNumFmt(NumberFormat val) {
if (val!= null) {
object.setNumFmt(new com.alphasystem.docx4j.builder.wml.NumFmtBuilder().withVal(val).getObject());
}
return this;
}
public CTEdnPropsBuilder withNumStart(CTEdnProps.NumStart value) {
if (value!= null) {
object.setNumStart(value);
}
return this;
}
public CTEdnPropsBuilder withNumStart(Long val) {
boolean initialized = (val!= null);
if (initialized) {
withNumStart(numStartBuilder.withVal(val).getObject());
}
return this;
}
public CTEdnPropsBuilder.NumStartBuilder getNumStartBuilder() {
return numStartBuilder;
}
public CTEdnPropsBuilder withNumRestart(CTNumRestart value) {
if (value!= null) {
object.setNumRestart(value);
}
return this;
}
public CTEdnPropsBuilder withNumRestart(STRestartNumber val) {
if (val!= null) {
object.setNumRestart(new com.alphasystem.docx4j.builder.wml.CTNumRestartBuilder().withVal(val).getObject());
}
return this;
}
/**
* Fluent API builder for org.docx4j.wml.CTEdnProps$NumStart
.
*
*/
public static class NumStartBuilder
extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{
/**
* Initialize the underlying object.
*
*/
public NumStartBuilder() {
this(null);
}
/**
* Initialize the builder with given object.
*
* @param object
* the given object
*/
public NumStartBuilder(CTEdnProps.NumStart 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 NumStartBuilder(CTEdnProps.NumStart src, CTEdnProps.NumStart target) {
this(target);
if (src!= null) {
withVal(WmlBuilderFactory.cloneBigInteger(src.getVal()));
}
}
protected CTEdnProps.NumStart createObject() {
return WmlBuilderFactory.OBJECT_FACTORY.createCTEdnPropsNumStart();
}
public CTEdnPropsBuilder.NumStartBuilder withVal(BigInteger value) {
if (value!= null) {
object.setVal(value);
}
return this;
}
/**
* Calls setVal
method.
*
* @param value
* Value to set
* @return
* reference to this
*/
public CTEdnPropsBuilder.NumStartBuilder 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 CTEdnPropsBuilder.NumStartBuilder withVal(Long value) {
if (value!= null) {
object.setVal(BigInteger.valueOf(value));
}
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy