com.alphasystem.docx4j.builder.wml.NumberingNumBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of open-xml-builder Show documentation
Show all versions of open-xml-builder Show documentation
Alpha system commons library
package com.alphasystem.docx4j.builder.wml;
import java.math.BigInteger;
import java.util.List;
/**
* Fluent API builder for org.docx4j.wml.Numbering$Num
.
*
*/
public class NumberingNumBuilder
extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{
private NumberingNumBuilder.AbstractNumIdBuilder abstractNumIdBuilder;
/**
* Initialize the underlying object.
*
*/
public NumberingNumBuilder() {
this(null);
}
/**
* Initialize the builder with given object.
*
* @param object
* the given object
*/
public NumberingNumBuilder(org.docx4j.wml.Numbering.Num object) {
super(object);
abstractNumIdBuilder = new NumberingNumBuilder.AbstractNumIdBuilder(this.object.getAbstractNumId());
}
/**
* 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 NumberingNumBuilder(org.docx4j.wml.Numbering.Num src, org.docx4j.wml.Numbering.Num target) {
this(target);
if (src!= null) {
org.docx4j.wml.Numbering.Num.AbstractNumId abstractNumId = src.getAbstractNumId();
if (abstractNumId!= null) {
abstractNumId = new NumberingNumBuilder.AbstractNumIdBuilder(abstractNumId, object.getAbstractNumId()).getObject();
}
List lvlOverride = src.getLvlOverride();
for (org.docx4j.wml.Numbering.Num.LvlOverride o: lvlOverride) {
addLvlOverride(new NumberingNumLvlOverrideBuilder(o, null).getObject());
}
withAbstractNumId(abstractNumId).withNumId(WmlBuilderFactory.cloneBigInteger(src.getNumId()));
}
}
protected org.docx4j.wml.Numbering.Num createObject() {
return WmlBuilderFactory.OBJECT_FACTORY.createNumberingNum();
}
public NumberingNumBuilder withAbstractNumId(org.docx4j.wml.Numbering.Num.AbstractNumId value) {
if (value!= null) {
object.setAbstractNumId(value);
}
return this;
}
public NumberingNumBuilder withAbstractNumId(Long val) {
boolean initialized = (val!= null);
if (initialized) {
withAbstractNumId(abstractNumIdBuilder.withVal(val).getObject());
}
return this;
}
public NumberingNumBuilder.AbstractNumIdBuilder getAbstractNumIdBuilder() {
return abstractNumIdBuilder;
}
public NumberingNumBuilder addLvlOverride(org.docx4j.wml.Numbering.Num.LvlOverride... value) {
addContent(object.getLvlOverride(), value);
return this;
}
public NumberingNumBuilder withNumId(BigInteger value) {
if (value!= null) {
object.setNumId(value);
}
return this;
}
/**
* Calls setNumId
method.
*
* @param value
* Value to set
* @return
* reference to this
*/
public NumberingNumBuilder withNumId(String value) {
if (value!= null) {
object.setNumId(new BigInteger(value));
}
return this;
}
/**
* Calls setNumId
method.
*
* @param value
* Value to set
* @return
* reference to this
*/
public NumberingNumBuilder withNumId(Long value) {
if (value!= null) {
object.setNumId(BigInteger.valueOf(value));
}
return this;
}
/**
* Fluent API builder for org.docx4j.wml.Numbering$Num$AbstractNumId
.
*
*/
public static class AbstractNumIdBuilder
extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{
/**
* Initialize the underlying object.
*
*/
public AbstractNumIdBuilder() {
this(null);
}
/**
* Initialize the builder with given object.
*
* @param object
* the given object
*/
public AbstractNumIdBuilder(org.docx4j.wml.Numbering.Num.AbstractNumId 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 AbstractNumIdBuilder(org.docx4j.wml.Numbering.Num.AbstractNumId src, org.docx4j.wml.Numbering.Num.AbstractNumId target) {
this(target);
if (src!= null) {
withVal(WmlBuilderFactory.cloneBigInteger(src.getVal()));
}
}
protected org.docx4j.wml.Numbering.Num.AbstractNumId createObject() {
return WmlBuilderFactory.OBJECT_FACTORY.createNumberingNumAbstractNumId();
}
public NumberingNumBuilder.AbstractNumIdBuilder withVal(BigInteger value) {
if (value!= null) {
object.setVal(value);
}
return this;
}
/**
* Calls setVal
method.
*
* @param value
* Value to set
* @return
* reference to this
*/
public NumberingNumBuilder.AbstractNumIdBuilder 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 NumberingNumBuilder.AbstractNumIdBuilder withVal(Long value) {
if (value!= null) {
object.setVal(BigInteger.valueOf(value));
}
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy