@Override public boolean removeChild(Object key) { return possiblyDetach(value.putChild(key, null)) != null; }
detachIfNonNull(newValue.putChild(child.key, child)); value = newValue;
detachIfNonNull(newValue.putChild(child.key, child)); value = newValue;
@Override public boolean removeChild(@NonNull Object key) { return detachIfNonNull(value.putChild(key, null)) != null; }
@Override public boolean removeChild(@NonNull Object key) { return detachIfNonNull(value.putChild(key, null)) != null; }
protected void attachChild(SimpleConfigurationNode child) { if (isVirtual()) { throw new IllegalStateException("This parent is not currently attached. This is an internal state violation."); } if (!child.getParentAttached().equals(this)) { throw new IllegalStateException("Child " + child + " path is not a direct parent of me (" + this + "), cannot attach"); } ConfigValue oldValue, newValue; synchronized (this) { newValue = oldValue = this.value; if (!(oldValue instanceof MapConfigValue)) { if (child.key instanceof Integer) { if (oldValue instanceof NullConfigValue) { newValue = new ListConfigValue(this); } else if (!(oldValue instanceof ListConfigValue)) { newValue = new ListConfigValue(this, oldValue.getValue()); } } else { newValue = new MapConfigValue(this); } } possiblyDetach(newValue.putChild(child.key, child)); value = newValue; } if (newValue != oldValue) { oldValue.clear(); } child.attached = true; }