class RgbaCssValue extends AbstractBean<RgbaCssValue> {

    public static boolean isValid(final String rgbaString) {
        try {
            final String rgbaStringLowerCase = rgbaString.replace(" ", "")
                    .toLowerCase();
            if (rgbaStringLowerCase.startsWith("rgba(")
                    && rgbaStringLowerCase.contains(")")) {

                final String[] rgbaStringParts = StringUtil
                        .splitByComma(rgbaStringLowerCase.substring(
                                rgbaStringLowerCase.indexOf('(') + 1,
                                rgbaStringLowerCase.lastIndexOf(')')));

                if (rgbaStringParts.length == 4) {
                    final int r = Integer.parseInt(rgbaStringParts[0]);
                    if (r < 0 || r > 255) {
                        return false;
                    }
                    final int g = Integer.parseInt(rgbaStringParts[1]);
                    if (g < 0 || g > 255) {
                        return false;
                    }
                    final int b = Integer.parseInt(rgbaStringParts[2]);
                    if (b < 0 || b > 255) {
                        return false;
                    }

                    final float a = Float.parseFloat(rgbaStringParts[3]);

                    return !(a < 0 || a > 1);
                }
                return false;
            }
        } catch (final NumberFormatException e) {
        }
        return false;
    }

    public  RgbaCssValue();
    public  RgbaCssValue(final String rgbaCssValue);
    public  RgbaCssValue(final RgbaCssValue rgbaCssValue);
    public  RgbaCssValue(final int r, final int g, final int b, final float a);

}