@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleCommentedConfigurationNode)) return false; if (!super.equals(o)) return false; SimpleCommentedConfigurationNode that = (SimpleCommentedConfigurationNode) o; if (!comment.equals(that.comment)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleCommentedConfigurationNode)) return false; if (!super.equals(o)) return false; SimpleCommentedConfigurationNode that = (SimpleCommentedConfigurationNode) o; if (!comment.equals(that.comment)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleCommentedConfigurationNode)) return false; if (!super.equals(o)) return false; SimpleCommentedConfigurationNode that = (SimpleCommentedConfigurationNode) o; if (!Objects.equals(comment, that.comment)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleAttributedConfigurationNode)) return false; if (!super.equals(o)) return false; SimpleAttributedConfigurationNode that = (SimpleAttributedConfigurationNode) o; return tagName.equals(that.tagName) && attributes.equals(that.attributes); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleAttributedConfigurationNode)) return false; if (!super.equals(o)) return false; SimpleAttributedConfigurationNode that = (SimpleAttributedConfigurationNode) o; return tagName.equals(that.tagName) && attributes.equals(that.attributes); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleConfigurationNode)) return false; SimpleConfigurationNode that = (SimpleConfigurationNode) o; if (attached != that.attached) return false; if (key != null ? !key.equals(that.key) : that.key != null) return false; if (!options.equals(that.options)) return false; if (parent != null ? !parent.equals(that.parent) : that.parent != null) return false; if (!value.equals(that.value)) return false; return true; }
void clear() { for (Iterator<SimpleConfigurationNode> it = iterateChildren().iterator(); it.hasNext();) { SimpleConfigurationNode node = it.next(); node.attached = false; it.remove(); if (node.getParentAttached().equals(holder)) { node.clear(); } } }
/** * Clears the set value (or any attached child values) from this value */ void clear() { for (Iterator<SimpleConfigurationNode> it = iterateChildren().iterator(); it.hasNext();) { SimpleConfigurationNode node = it.next(); node.attached = false; it.remove(); if (node.getParentEnsureAttached().equals(holder)) { node.clear(); } } }
/** * Clears the set value (or any attached child values) from this value */ void clear() { for (Iterator<SimpleConfigurationNode> it = iterateChildren().iterator(); it.hasNext();) { SimpleConfigurationNode node = it.next(); node.attached = false; it.remove(); if (node.getParentEnsureAttached().equals(holder)) { node.clear(); } } }
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");
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; }
if (!child.getParentEnsureAttached().equals(this)) { throw new IllegalStateException("Child " + child + " path is not a direct parent of me (" + this + "), cannot attach");
if (!child.getParentEnsureAttached().equals(this)) { throw new IllegalStateException("Child " + child + " path is not a direct parent of me (" + this + "), cannot attach");