RGBImageProfile implements ConfigurableExtension { @SuppressWarnings("LocalVariableHidesMemberVariable") public void setProperties(Properties properties) { final String name = properties.getProperty(PROPERTY_KEY_NAME); final String[] rgbaExpressions = new String[]{ getProperty(properties, new String[]{PROPERTY_KEY_RED, "r"}, ""), getProperty(properties, new String[]{PROPERTY_KEY_GREEN, "g"}, ""), getProperty(properties, new String[]{PROPERTY_KEY_BLUE, "b"}, ""), getProperty(properties, new String[]{PROPERTY_KEY_ALPHA, "a"}, "") }; final boolean internal = Boolean.parseBoolean(properties.getProperty(PROPERTY_KEY_INTERNAL, "false")); if (name != null) { setName(name); } setInternal(internal); setRgbaExpressions(rgbaExpressions); } RGBImageProfile();  RGBImageProfile(final String name);  RGBImageProfile(final String name, String[] rgbaExpressions);  RGBImageProfile(final String name, String[] rgbaExpressions, String pattern[]); String getName(); void setName(String name); boolean isInternal(); void setInternal(final boolean internal); boolean equalExpressions(RGBImageProfile profile); boolean equalExpressions(String[] rgbaExpressions); boolean isValid(); String[] getRgbExpressions(); void setRgbExpressions(String[] rgbExpressions); String[] getRgbaExpressions(); void setRgbaExpressions(String[] rgbaExpressions); String getRedExpression(); void setRedExpression(String expression); String getGreenExpression(); void setGreenExpression(String expression); String getBlueExpression(); void setBlueExpression(String expression); String getAlphaExpression(); void setAlphaExpression(String expression); boolean hasAlpha(); String[] getPattern(); void setPattern(String[] pattern); boolean isApplicableTo(final Product product); static RGBImageProfile getCurrentProfile(final Product product); static RGBImageProfile loadProfile(final File file); static RGBImageProfile loadProfile(final URL url); void store(final File file); void getProperties(final Properties properties); @SuppressWarnings("LocalVariableHidesMemberVariable") void setProperties(Properties properties); static void storeRgbaExpressions(final Product product, final String[] rgbaExpressions); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); void configure(ConfigurationElement config); static final String RED_BAND_NAME; static final String GREEN_BAND_NAME; static final String BLUE_BAND_NAME; static final String ALPHA_BAND_NAME; static final String[] RGB_BAND_NAMES; static final String[] RGBA_BAND_NAMES; static final String FILENAME_EXTENSION; static final String PROPERTY_KEY_NAME; static final String PROPERTY_KEY_RED; static final String PROPERTY_KEY_GREEN; static final String PROPERTY_KEY_BLUE; static final String PROPERTY_KEY_ALPHA; static final String PROPERTY_KEY_INTERNAL; final static String PROPERTY_KEY_PREFIX_RGB_PROFILE; }
@Test public void testSetProperties() throws Exception { RGBImageProfile profile = new RGBImageProfile(); Properties properties = new Properties(); properties.setProperty(RGBImageProfile.PROPERTY_KEY_NAME, "name"); properties.setProperty(RGBImageProfile.PROPERTY_KEY_ALPHA, "alpha"); properties.setProperty(RGBImageProfile.PROPERTY_KEY_BLUE, "blue"); properties.setProperty(RGBImageProfile.PROPERTY_KEY_GREEN, "green"); properties.setProperty(RGBImageProfile.PROPERTY_KEY_RED, "red"); properties.setProperty(RGBImageProfile.PROPERTY_KEY_INTERNAL, String.valueOf(true)); profile.setProperties(properties); assertEquals("name", profile.getName()); assertTrue(profile.isInternal()); assertTrue(Arrays.equals(new String[] {"red", "green", "blue", "alpha"}, profile.getRgbaExpressions())); }