com.alphasystem.docx4j.builder.wml.UBuilder Maven / Gradle / Ivy
package com.alphasystem.docx4j.builder.wml;
import com.alphasystem.docx4j.builder.OpenXmlBuilder;
import org.docx4j.wml.STThemeColor;
import org.docx4j.wml.U;
import org.docx4j.wml.UnderlineEnumeration;
/**
* Fluent API builder for org.docx4j.wml.U
.
*
*/
public class UBuilder
extends OpenXmlBuilder
{
/**
* Initialize the underlying object.
*
*/
public UBuilder() {
this(null);
}
/**
* Initialize the builder with given object.
*
* @param object
* the given object
*/
public UBuilder(U 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 UBuilder(U src, U target) {
this(target);
if (src!= null) {
withVal(src.getVal()).withColor(src.getColor()).withThemeColor(src.getThemeColor()).withThemeTint(src.getThemeTint()).withThemeShade(src.getThemeShade());
}
}
protected U createObject() {
return WmlBuilderFactory.OBJECT_FACTORY.createU();
}
public UBuilder withVal(UnderlineEnumeration value) {
if (value!= null) {
object.setVal(value);
}
return this;
}
public UBuilder withColor(String value) {
if (value!= null) {
object.setColor(value);
}
return this;
}
public UBuilder withThemeColor(STThemeColor value) {
if (value!= null) {
object.setThemeColor(value);
}
return this;
}
public UBuilder withThemeTint(String value) {
if (value!= null) {
object.setThemeTint(value);
}
return this;
}
public UBuilder withThemeShade(String value) {
if (value!= null) {
object.setThemeShade(value);
}
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy