wffweb/src/main/java/com/webfirmframework/wffweb/css/BorderWidth.java
public void setBorderWidth(final BorderTopWidth borderTopWidth,
            final BorderRightWidth borderRightWidth,
            final BorderBottomWidth borderBottomWidth,
            final BorderLeftWidth borderLeftWidth) {

        if (borderTopWidth != null && borderRightWidth != null
                && borderBottomWidth != null && borderLeftWidth != null) {

            if (BorderTopWidth.INITIAL.equals(borderTopWidth.getCssValue())
                    || BorderTopWidth.INHERIT
                            .equals(borderTopWidth.getCssValue())
                    || BorderRightWidth.INITIAL
                            .equals(borderRightWidth.getCssValue())
                    || BorderRightWidth.INHERIT
                            .equals(borderRightWidth.getCssValue())
                    || BorderBottomWidth.INITIAL
                            .equals(borderBottomWidth.getCssValue())
                    || BorderBottomWidth.INHERIT
                            .equals(borderBottomWidth.getCssValue())
                    || BorderLeftWidth.INITIAL
                            .equals(borderLeftWidth.getCssValue())
                    || BorderLeftWidth.INHERIT
                            .equals(borderLeftWidth.getCssValue())) {
                throw new InvalidValueException(
                        "Any or all of the given arguments have initial/inherit constant value as its cssValue");
            }

            try {
                final BorderTopWidth borderTopWidthTemp;
                final BorderRightWidth borderRightWidthTemp;
                final BorderBottomWidth borderBottomWidthTemp;
                final BorderLeftWidth borderLeftWidthTemp;

                if (this.borderTopWidth != null) {
                    this.borderTopWidth.setAlreadyInUse(false);
                    this.borderRightWidth.setAlreadyInUse(false);
                    this.borderBottomWidth.setAlreadyInUse(false);
                    this.borderLeftWidth.setAlreadyInUse(false);
                }

                if (borderTopWidth.isAlreadyInUse()
                        && this.borderTopWidth != borderTopWidth) {
                    if (this.borderTopWidth != null) {
                        borderTopWidthTemp = this.borderTopWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderTopWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderTopWidthTemp = borderTopWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderTopWidth is already used by another object so its clone is assigned");
                        }
                    }
                } else {
                    borderTopWidthTemp = borderTopWidth;
                }

                if (borderRightWidth.isAlreadyInUse()
                        && this.borderRightWidth != borderRightWidth) {
                    if (this.borderRightWidth != null) {
                        borderRightWidthTemp = this.borderRightWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderRightWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderRightWidthTemp = borderRightWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderRightWidth is already used by another object so its clone is assigned");
                        }
                    }

                } else {
                    borderRightWidthTemp = borderRightWidth;
                }

                if (borderBottomWidth.isAlreadyInUse()
                        && this.borderBottomWidth != borderBottomWidth) {
                    if (this.borderBottomWidth != null) {
                        borderBottomWidthTemp = this.borderBottomWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderBottomWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderBottomWidthTemp = borderBottomWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderBottomWidth is already used by another object so its clone is assigned");
                        }
                    }

                } else {
                    borderBottomWidthTemp = borderBottomWidth;
                }

                if (borderLeftWidth.isAlreadyInUse()
                        && this.borderLeftWidth != borderLeftWidth) {
                    if (this.borderLeftWidth != null) {
                        borderLeftWidthTemp = this.borderLeftWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderLeftWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderLeftWidthTemp = borderLeftWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderLeftWidth is already used by another object so its clone is assigned");
                        }
                    }

                } else {
                    borderLeftWidthTemp = borderLeftWidth;
                }

                borderTopWidthTemp.setAlreadyInUse(true);
                borderTopWidthTemp.setStateChangeInformer(this);

                borderRightWidthTemp.setAlreadyInUse(true);
                borderRightWidthTemp.setStateChangeInformer(this);

                borderBottomWidthTemp.setAlreadyInUse(true);
                borderBottomWidthTemp.setStateChangeInformer(this);

                borderLeftWidthTemp.setAlreadyInUse(true);
                borderLeftWidthTemp.setStateChangeInformer(this);

                assignProducedCssValue(borderTopWidth, borderRightWidth,
                        borderBottomWidth, borderLeftWidth);

                this.borderTopWidth = borderTopWidthTemp;
                this.borderRightWidth = borderRightWidthTemp;
                this.borderBottomWidth = borderBottomWidthTemp;
                this.borderLeftWidth = borderLeftWidthTemp;

            } catch (final CloneNotSupportedException e) {
                throw new InvalidValueException(e);
            } catch (final Exception e) {
                throw new InvalidValueException(e);
            }

        } else {
            throw new NullValueException("cannot accept null arguments");
        }

    }
public void setBorderWidth(final BorderTopWidth borderTopWidth,
            final BorderRightWidth borderRightWidth,
            final BorderBottomWidth borderBottomWidth,
            final BorderLeftWidth borderLeftWidth) {

        if (borderTopWidth != null && borderRightWidth != null
                && borderBottomWidth != null && borderLeftWidth != null) {

            if (BorderTopWidth.INITIAL.equals(borderTopWidth.getCssValue())
                    || BorderTopWidth.INHERIT
                            .equals(borderTopWidth.getCssValue())
                    || BorderRightWidth.INITIAL
                            .equals(borderRightWidth.getCssValue())
                    || BorderRightWidth.INHERIT
                            .equals(borderRightWidth.getCssValue())
                    || BorderBottomWidth.INITIAL
                            .equals(borderBottomWidth.getCssValue())
                    || BorderBottomWidth.INHERIT
                            .equals(borderBottomWidth.getCssValue())
                    || BorderLeftWidth.INITIAL
                            .equals(borderLeftWidth.getCssValue())
                    || BorderLeftWidth.INHERIT
                            .equals(borderLeftWidth.getCssValue())) {
                throw new InvalidValueException(
                        "Any or all of the given arguments have initial/inherit constant value as its cssValue");
            }

            try {
                final BorderTopWidth borderTopWidthTemp;
                final BorderRightWidth borderRightWidthTemp;
                final BorderBottomWidth borderBottomWidthTemp;
                final BorderLeftWidth borderLeftWidthTemp;

                if (this.borderTopWidth != null) {
                    this.borderTopWidth.setAlreadyInUse(false);
                    this.borderRightWidth.setAlreadyInUse(false);
                    this.borderBottomWidth.setAlreadyInUse(false);
                    this.borderLeftWidth.setAlreadyInUse(false);
                }

                if (borderTopWidth.isAlreadyInUse()
                        && this.borderTopWidth != borderTopWidth) {
                    if (this.borderTopWidth != null) {
                        borderTopWidthTemp = this.borderTopWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderTopWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderTopWidthTemp = borderTopWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderTopWidth is already used by another object so its clone is assigned");
                        }
                    }
                } else {
                    borderTopWidthTemp = borderTopWidth;
                }

                if (borderRightWidth.isAlreadyInUse()
                        && this.borderRightWidth != borderRightWidth) {
                    if (this.borderRightWidth != null) {
                        borderRightWidthTemp = this.borderRightWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderRightWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderRightWidthTemp = borderRightWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderRightWidth is already used by another object so its clone is assigned");
                        }
                    }

                } else {
                    borderRightWidthTemp = borderRightWidth;
                }

                if (borderBottomWidth.isAlreadyInUse()
                        && this.borderBottomWidth != borderBottomWidth) {
                    if (this.borderBottomWidth != null) {
                        borderBottomWidthTemp = this.borderBottomWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderBottomWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderBottomWidthTemp = borderBottomWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderBottomWidth is already used by another object so its clone is assigned");
                        }
                    }

                } else {
                    borderBottomWidthTemp = borderBottomWidth;
                }

                if (borderLeftWidth.isAlreadyInUse()
                        && this.borderLeftWidth != borderLeftWidth) {
                    if (this.borderLeftWidth != null) {
                        borderLeftWidthTemp = this.borderLeftWidth
                                .setCssValue(borderTopWidth.getCssValue());
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderLeftWidth is already used by another object so the existing object is used");
                        }
                    } else {
                        borderLeftWidthTemp = borderLeftWidth.clone();
                        if (LOGGER.isLoggable(Level.WARNING)) {
                            LOGGER.warning(
                                    "the given borderLeftWidth is already used by another object so its clone is assigned");
                        }
                    }

                } else {
                    borderLeftWidthTemp = borderLeftWidth;
                }

                borderTopWidthTemp.setAlreadyInUse(true);
                borderTopWidthTemp.setStateChangeInformer(this);

                borderRightWidthTemp.setAlreadyInUse(true);
                borderRightWidthTemp.setStateChangeInformer(this);

                borderBottomWidthTemp.setAlreadyInUse(true);
                borderBottomWidthTemp.setStateChangeInformer(this);

                borderLeftWidthTemp.setAlreadyInUse(true);
                borderLeftWidthTemp.setStateChangeInformer(this);

                assignProducedCssValue(borderTopWidth, borderRightWidth,
                        borderBottomWidth, borderLeftWidth);

                this.borderTopWidth = borderTopWidthTemp;
                this.borderRightWidth = borderRightWidthTemp;
                this.borderBottomWidth = borderBottomWidthTemp;
                this.borderLeftWidth = borderLeftWidthTemp;

            } catch (final CloneNotSupportedException e) {
                throw new InvalidValueException(e);
            } catch (final Exception e) {
                throw new InvalidValueException(e);
            }

        } else {
            throw new NullValueException("cannot accept null arguments");
        }

    }
public void setBorderWidth ( final BorderTopWidth borderTopWidth , final BorderRightWidth borderRightWidth , final BorderBottomWidth borderBottomWidth , final BorderLeftWidth borderLeftWidth ) { if ( borderTopWidth != null && borderRightWidth != null && borderBottomWidth != null && borderLeftWidth != null ) { if ( BorderTopWidth . INITIAL . equals ( borderTopWidth . getCssValue ( ) ) || BorderTopWidth . INHERIT . equals ( borderTopWidth . getCssValue ( ) ) || BorderRightWidth . INITIAL . equals ( borderRightWidth . getCssValue ( ) ) || BorderRightWidth . INHERIT . equals ( borderRightWidth . getCssValue ( ) ) || BorderBottomWidth . INITIAL . equals ( borderBottomWidth . getCssValue ( ) ) || BorderBottomWidth . INHERIT . equals ( borderBottomWidth . getCssValue ( ) ) || BorderLeftWidth . INITIAL . equals ( borderLeftWidth . getCssValue ( ) ) || BorderLeftWidth . INHERIT . equals ( borderLeftWidth . getCssValue ( ) ) ) { throw new InvalidValueException ( "Any or all of the given arguments have initial/inherit constant value as its cssValue" ) ; } try { final BorderTopWidth borderTopWidthTemp ; final BorderRightWidth borderRightWidthTemp ; final BorderBottomWidth borderBottomWidthTemp ; final BorderLeftWidth borderLeftWidthTemp ; if ( this . borderTopWidth != null ) { this . borderTopWidth . setAlreadyInUse ( false ) ; this . borderRightWidth . setAlreadyInUse ( false ) ; this . borderBottomWidth . setAlreadyInUse ( false ) ; this . borderLeftWidth . setAlreadyInUse ( false ) ; } if ( borderTopWidth . isAlreadyInUse ( ) && this . borderTopWidth != borderTopWidth ) { if ( this . borderTopWidth != null ) { borderTopWidthTemp = this . borderTopWidth . setCssValue ( borderTopWidth . getCssValue ( ) ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderTopWidth is already used by another object so the existing object is used" ) ; } } else { borderTopWidthTemp = borderTopWidth . clone ( ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderTopWidth is already used by another object so its clone is assigned" ) ; } } } else { borderTopWidthTemp = borderTopWidth ; } if ( borderRightWidth . isAlreadyInUse ( ) && this . borderRightWidth != borderRightWidth ) { if ( this . borderRightWidth != null ) { borderRightWidthTemp = this . borderRightWidth . setCssValue ( borderTopWidth . getCssValue ( ) ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderRightWidth is already used by another object so the existing object is used" ) ; } } else { borderRightWidthTemp = borderRightWidth . clone ( ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderRightWidth is already used by another object so its clone is assigned" ) ; } } } else { borderRightWidthTemp = borderRightWidth ; } if ( borderBottomWidth . isAlreadyInUse ( ) && this . borderBottomWidth != borderBottomWidth ) { if ( this . borderBottomWidth != null ) { borderBottomWidthTemp = this . borderBottomWidth . setCssValue ( borderTopWidth . getCssValue ( ) ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderBottomWidth is already used by another object so the existing object is used" ) ; } } else { borderBottomWidthTemp = borderBottomWidth . clone ( ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderBottomWidth is already used by another object so its clone is assigned" ) ; } } } else { borderBottomWidthTemp = borderBottomWidth ; } if ( borderLeftWidth . isAlreadyInUse ( ) && this . borderLeftWidth != borderLeftWidth ) { if ( this . borderLeftWidth != null ) { borderLeftWidthTemp = this . borderLeftWidth . setCssValue ( borderTopWidth . getCssValue ( ) ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderLeftWidth is already used by another object so the existing object is used" ) ; } } else { borderLeftWidthTemp = borderLeftWidth . clone ( ) ; if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . warning ( "the given borderLeftWidth is already used by another object so its clone is assigned" ) ; } } } else { borderLeftWidthTemp = borderLeftWidth ; } borderTopWidthTemp . setAlreadyInUse ( true ) ; borderTopWidthTemp . setStateChangeInformer ( this ) ; borderRightWidthTemp . setAlreadyInUse ( true ) ; borderRightWidthTemp . setStateChangeInformer ( this ) ; borderBottomWidthTemp . setAlreadyInUse ( true ) ; borderBottomWidthTemp . setStateChangeInformer ( this ) ; borderLeftWidthTemp . setAlreadyInUse ( true ) ; borderLeftWidthTemp . setStateChangeInformer ( this ) ; assignProducedCssValue ( borderTopWidth , borderRightWidth , borderBottomWidth , borderLeftWidth ) ; this . borderTopWidth = borderTopWidthTemp ; this . borderRightWidth = borderRightWidthTemp ; this . borderBottomWidth = borderBottomWidthTemp ; this . borderLeftWidth = borderLeftWidthTemp ; } catch ( final CloneNotSupportedException e ) { throw new InvalidValueException ( e ) ; } catch ( final Exception e ) { throw new InvalidValueException ( e ) ; } } else { throw new NullValueException ( "cannot accept null arguments" ) ; } }
sets the top, right, bottom and left width in {@code BorderWidth}. If the
given argument is already used by another object, then the
existing/cloned object will be used. And throws
{@code NullValueException} if any of the given argument is null.

@param borderTopWidth
@param borderRightWidth
@param borderBottomWidth
@param borderLeftWidth
@author WFF
@since 1.0.0
sets the top right bottom and left width in { @code BorderWidth } . If the given argument is already used by another object then the existing / cloned object will be used . And throws { @code NullValueException } if any of the given argument is null .