@Test public void testUpdateOriginalValue() { Integer cascadingValue = 10; Integer candidateValue = 11; property.setOriginalValue(1, false); assertFalse(property.isOverridden()); assertNotNull(property.getOriginalValue()); boolean result = property.updateOriginalValue(candidateValue, cascadingValue); assertTrue(result); assertTrue(property.isOverridden()); assertEquals(candidateValue, property.getOriginalValue()); result = property.updateOriginalValue(cascadingValue, cascadingValue); assertFalse(result); assertFalse(property.isOverridden()); assertNull(property.getOriginalValue()); }
protected boolean updateOriginalValue(T value, T cascadingValue) { T candidateValue = null == value ? getDefaultValue() : value; if (allowOverrideValue(cascadingValue, candidateValue)) { setOriginalValue(value, true); return true; } else { clearOriginalValue(value); return false; } }
BaseProjectProperty implements IProjectProperty<T> { protected boolean updateOriginalValue(T value, T cascadingValue) { T candidateValue = null == value ? getDefaultValue() : value; if (allowOverrideValue(cascadingValue, candidateValue)) { setOriginalValue(value, true); return true; } else { clearOriginalValue(value); return false; } } }
BaseProjectProperty implements IProjectProperty<T> { protected boolean updateOriginalValue(T value, T cascadingValue) { T candidateValue = null == value ? getDefaultValue() : value; if (allowOverrideValue(cascadingValue, candidateValue)) { setOriginalValue(value, true); return true; } else { clearOriginalValue(value); return false; } } BaseProjectProperty(ICascadingJob job); }
BaseProjectProperty implements IProjectProperty<T> { protected boolean updateOriginalValue(T value, T cascadingValue) { T candidateValue = null == value ? getDefaultValue() : value; if (allowOverrideValue(cascadingValue, candidateValue)) { setOriginalValue(value, true); return true; } else { clearOriginalValue(value); return false; } } BaseProjectProperty(ICascadingJob job); void setKey(String propertyKey); String getKey(); void setJob(ICascadingJob job); void setOverridden(boolean overridden); @SuppressWarnings("unchecked") T getCascadingValue(); boolean isOverridden(); T getDefaultValue(); T getValue(); @SuppressWarnings("unchecked") void setValue(T value); void resetValue(); boolean allowOverrideValue(T cascadingValue, T candidateValue); T getOriginalValue(); final void onCascadingProjectChanged(); }
BaseProjectProperty implements IProjectProperty<T> { protected boolean updateOriginalValue(T value, T cascadingValue) { T candidateValue = null == value ? getDefaultValue() : value; if (allowOverrideValue(cascadingValue, candidateValue)) { setOriginalValue(value, true); return true; } else { clearOriginalValue(value); return false; } } BaseProjectProperty(ICascadingJob job); void setKey(String propertyKey); String getKey(); void setJob(ICascadingJob job); void setOverridden(boolean overridden); @SuppressWarnings("unchecked") T getCascadingValue(); boolean isOverridden(); T getDefaultValue(); T getValue(); @SuppressWarnings("unchecked") void setValue(T value); void resetValue(); boolean allowOverrideValue(T cascadingValue, T candidateValue); T getOriginalValue(); final void onCascadingProjectChanged();  }