WebkitFlex extends AbstractCssProperty<WebkitFlex> implements StateChangeInformer<CssProperty> { public WebkitFlex setWebkitFlexBasis( final WebkitFlexBasis webkitFlexBasis) { if (webkitFlexBasis == null) { throw new InvalidValueException("webkitFlexBasis cannot be null"); } if (Objects.equals(this.webkitFlexBasis, webkitFlexBasis)) { return this; } final StringBuilder cssValueBuilder = new StringBuilder(); if (webkitFlexGrow == null) { webkitFlexGrow = new WebkitFlexGrow(1); webkitFlexGrow.setStateChangeInformer(this); webkitFlexGrow.setAlreadyInUse(true); } cssValueBuilder.append(webkitFlexGrow.getCssValue()).append(' '); if (webkitFlexShrink == null) { webkitFlexShrink = new WebkitFlexShrink(1); webkitFlexShrink.setStateChangeInformer(this); webkitFlexShrink.setAlreadyInUse(true); } cssValueBuilder.append(webkitFlexShrink.getCssValue()).append(' '); if (this.webkitFlexBasis != null) { this.webkitFlexBasis.setCssValue(webkitFlexBasis.getCssValue()); if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning( "copied the cssValue from the given webkitFlexBasis to the existing webkitFlexBasis object."); } } else { if (webkitFlexBasis.isAlreadyInUse()) { this.webkitFlexBasis = new WebkitFlexBasis(webkitFlexBasis); this.webkitFlexBasis.setAlreadyInUse(true); this.webkitFlexBasis.setStateChangeInformer(this); if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning( "created a new object of WebkitFlexBasis as the given webkitFlexBasis object is already used by another object"); } } else { this.webkitFlexBasis = webkitFlexBasis; this.webkitFlexBasis.setAlreadyInUse(true); this.webkitFlexBasis.setStateChangeInformer(this); } } cssValueBuilder.append(webkitFlexBasis.getCssValue()); cssValue = cssValueBuilder.toString(); if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } return this; } WebkitFlex();  WebkitFlex(final String cssValue);  WebkitFlex(final WebkitFlex webkitFlex); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override WebkitFlex setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); WebkitFlexBasis getWebkitFlexBasis(); WebkitFlexShrink getWebkitFlexShrink(); WebkitFlexGrow getWebkitFlexGrow(); WebkitFlex setWebkitFlexGrow(final WebkitFlexGrow webkitFlexGrow); WebkitFlex setWebkitFlexShrink(
            final WebkitFlexShrink webkitFlexShrink); WebkitFlex setWebkitFlexBasis(
            final WebkitFlexBasis webkitFlexBasis); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testSetWebkitFlexBasis() { final WebkitFlex flex = new WebkitFlex("6 5 25px"); final WebkitFlexBasis flexBasis1 = flex.getWebkitFlexBasis(); final WebkitFlexBasis flexBasis2 = new WebkitFlexBasis(2, CssLengthUnit.PX); flex.setWebkitFlexBasis(flexBasis2); assertEquals("6.0 5.0 2.0px", flex.getCssValue()); assertNotNull(flex.getWebkitFlexGrow()); assertEquals("6.0", flex.getWebkitFlexGrow().getCssValue()); assertNotNull(flex.getWebkitFlexShrink()); assertEquals("5.0", flex.getWebkitFlexShrink().getCssValue()); assertNotNull(flex.getWebkitFlexBasis()); assertEquals("2.0px", flex.getWebkitFlexBasis().getCssValue()); assertNotEquals(flexBasis1, flexBasis2); assertNotEquals(flexBasis2, flex.getWebkitFlexBasis()); assertEquals(flexBasis1, flex.getWebkitFlexBasis()); flex.setWebkitFlexBasis(flexBasis1); }