/** * Set a context property to a new value. If the provided value is null, then the property is removed. * * @param desc the property descriptor * @param value the property value * @param <T> the property parameter type * @throws NullPointerException if the descriptor argument is null */ public <T> void setProperty(PropertyDescriptor<T> desc, T value) throws NullPointerException { propertyManager.setProperty(desc, value); }
public void testGetProperty() { PropertyManager mgr = new PropertyManager(); mgr.setProperty(FOO, foo); Property<Foo> property = mgr.getProperty(FOO); assertEquals(foo, property.getValue()); }
/** * Set a context property to a new value. If the provided value is null, then the property is removed. * * @param desc the property descriptor * @param value the property value * @param <T> the property parameter type * @throws NullPointerException if the descriptor argument is null */ public <T> void setProperty(PropertyDescriptor<T> desc, T value) throws NullPointerException { propertyManager.setProperty(desc, value); }
/** * Set a context property to a new value. If the provided value is null, then the property is removed. * * @param desc the property descriptor * @param value the property value * @param <T> the property parameter type * @throws NullPointerException if the descriptor argument is null */ public <T> void setProperty(PropertyDescriptor<T> desc, T value) throws NullPointerException { propertyManager.setProperty(desc, value); }
public void testDisplayValue() { PropertyManager mgr = new PropertyManager(); mgr.setProperty(PropertyDescriptor.VFS_REFRESH_PERIOD, 4); Property<Integer> property = mgr.getProperty(PropertyDescriptor.VFS_REFRESH_PERIOD); assertEquals("4", property.getDisplayValue()); mgr.setProperty(SimpleAuthenticationPlugin.SIMPLE_PASSWORD, "the_password"); Property<String> secretProperty = mgr.getProperty(SimpleAuthenticationPlugin.SIMPLE_PASSWORD); assertEquals(PropertyDescriptor.SECRET_DISPLAY_VALUE, secretProperty.getDisplayValue()); assertEquals("the_password", secretProperty.getValue()); } }
/** * Set a context property to a new value. If the provided value is null, then the property is removed. * * @param desc the property descriptor * @param value the property value * @param <T> the property parameter type * @throws NullPointerException if the descriptor argument is null */ public <T> void setProperty(PropertyDescriptor<T> desc, T value) throws NullPointerException { propertyManager.setProperty(desc, value); }
/** * Set a context property to a new value. If the provided value is null, then the property is removed. * * @param desc the property descriptor * @param value the property value * @param <T> the property parameter type * @throws NullPointerException if the descriptor argument is null * @throws IllegalArgumentException if the string value cannot be converted to the property type */ public <T> void setProperty(PropertyDescriptor<T> desc, String value) throws NullPointerException, IllegalArgumentException { propertyManager.setProperty(desc, value); }