* and {@link StoreMetadataNode} which represents original state {@link #getOriginal()}.
*/
@NotThreadSafe
-final class ModifiedNode implements StoreTreeNode<ModifiedNode>, Identifiable<PathArgument>, NodeModification {
+final class ModifiedNode extends NodeModification implements StoreTreeNode<ModifiedNode> {
public static final Predicate<ModifiedNode> IS_TERMINAL_PREDICATE = new Predicate<ModifiedNode>() {
@Override
* @return original store metadata
*/
@Override
- public Optional<TreeNode> getOriginal() {
+ Optional<TreeNode> getOriginal() {
return original;
}
* @return modification type
*/
@Override
- public ModificationType getType() {
+ ModificationType getType() {
return modificationType;
}
* @return all recorded direct child modifications
*/
@Override
- public Iterable<ModifiedNode> getChildren() {
+ Iterable<ModifiedNode> getChildren() {
return children.values();
}
* It is used by the validation code to allow for a read-only view of the
* modification tree as we should never modify that during validation.
*/
-interface NodeModification extends Identifiable<PathArgument> {
+abstract class NodeModification implements Identifiable<PathArgument> {
/**
* Get the type of modification.
*
* @return Modification type.
*/
- ModificationType getType();
+ abstract ModificationType getType();
/**
* Get the original tree node to which the modification is to be applied.
* @return The original node, or {@link Optional#absent()} if the node is
* a new node.
*/
- Optional<TreeNode> getOriginal();
+ abstract Optional<TreeNode> getOriginal();
/**
* Get a read-only view of children nodes.
*
* @return Iterable of all children nodes.
*/
- Iterable<? extends NodeModification> getChildren();
+ abstract Iterable<? extends NodeModification> getChildren();
}