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

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


package com.alphasystem.docx4j.builder.wml;

import com.alphasystem.docx4j.builder.OpenXmlBuilder;
import org.docx4j.wml.CTBorder;
import org.docx4j.wml.TblBorders;


/**
 * Fluent API builder for org.docx4j.wml.TblBorders.
 * 
 */
public class TblBordersBuilder
    extends OpenXmlBuilder
{


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

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public TblBordersBuilder(TblBorders 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 TblBordersBuilder(TblBorders src, TblBorders 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();
            }
            withTop(top).withLeft(left).withBottom(bottom).withRight(right).withInsideH(insideH).withInsideV(insideV);
        }
    }

    protected TblBorders createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createTblBorders();
    }

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

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

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

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

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

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy