public void setTitle(String title) { if (properties != null) { properties.setValue(PropertyType.TITLE, title); } }
@Test public void testMultiValueDelegate() { PropertyMap pm1 = new PropertyMap(); PropertyMap pm2 = new PropertyMap(pm1); pm1.setValues(FOO, "1", "2"); assertEquals(Arrays.asList("1", "2"), pm2.getValues(FOO)); pm2.setValue(FOO, "3"); assertEquals(Arrays.asList("1", "2"), pm1.getValues(FOO)); assertEquals(Arrays.asList("3"), pm2.getValues(FOO)); }
public void setTitle(String title) { if (properties != null) { properties.setValue(PropertyType.TITLE, title); } }
@Test public void testMultiValueDelegate() { PropertyMap pm1 = new PropertyMap(); PropertyMap pm2 = new PropertyMap(pm1); pm1.setValues(FOO, "1", "2"); assertEquals(Arrays.asList("1", "2"), pm2.getValues(FOO)); pm2.setValue(FOO, "3"); assertEquals(Arrays.asList("1", "2"), pm1.getValues(FOO)); assertEquals(Arrays.asList("3"), pm2.getValues(FOO)); }
public <T> Dispatch setProperty(PropertyType<T> propertyType, T propertyValue) throws IllegalArgumentException { String invalid = bridge.checkPropertyValidity(propertyType, propertyValue); if (invalid != null) { throw new IllegalArgumentException(invalid); } if (properties == null) { properties = new PropertyMap(); } properties.setValue(propertyType, propertyValue); return this; }
public <T> Dispatch setProperty(PropertyType<T> propertyType, T propertyValue) throws IllegalArgumentException { String invalid = bridge.checkPropertyValidity(propertyType, propertyValue); if (invalid != null) { throw new IllegalArgumentException(invalid); } if (properties == null) { properties = new PropertyMap(); } properties.setValue(propertyType, propertyValue); return this; }
@Test public void testSingleValue() { PropertyMap pm = new PropertyMap(); pm.setValue(FOO, "1"); assertEquals("1", pm.getValue(FOO)); assertEquals(Arrays.asList("1"), pm.getValues(FOO)); assertTrue(pm.contains(FOO)); }
@Test public void testSingleValue() { PropertyMap pm = new PropertyMap(); pm.setValue(FOO, "1"); assertEquals("1", pm.getValue(FOO)); assertEquals(Arrays.asList("1"), pm.getValues(FOO)); assertTrue(pm.contains(FOO)); }
@Test public void testRemoveSingleValue() { PropertyMap pm = new PropertyMap(); pm.setValue(FOO, "1"); pm.remove(FOO); assertNull(pm.getValue(FOO)); assertFalse(pm.contains(FOO)); }
@Test public void testRemoveSingleValue() { PropertyMap pm = new PropertyMap(); pm.setValue(FOO, "1"); pm.remove(FOO); assertNull(pm.getValue(FOO)); assertFalse(pm.contains(FOO)); }