Package org.jboss.shrinkwrap.impl.base
Class NodeImpl
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.NodeImpl
-
- All Implemented Interfaces:
Node
public class NodeImpl extends Object implements Node
The default implementation ofNode- Author:
- German Escobar
-
-
Constructor Summary
Constructors Constructor Description NodeImpl(ArchivePath path)Constructor This constructor will create a directory Node with the specified path.NodeImpl(ArchivePath path, Asset asset)Constructor This constructor will create an asset Node with the specified path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(Node node)Adds a child to the Set of nodes.booleanequals(Object obj)AssetgetAsset()Set<Node>getChildren()ArchivePathgetPath()inthashCode()voidremoveChild(Node node)Removes a child from the Set of nodes.StringtoString()
-
-
-
Constructor Detail
-
NodeImpl
public NodeImpl(ArchivePath path)
Constructor This constructor will create a directory Node with the specified path.- Parameters:
path- TheArchivePaththis Node is placed within theArchive
-
NodeImpl
public NodeImpl(ArchivePath path, Asset asset)
Constructor This constructor will create an asset Node with the specified path.- Parameters:
path- TheArchivePaththis Node is placed within theArchiveasset- TheAssetthat this Node holds.
-
-
Method Detail
-
getPath
public ArchivePath getPath()
-
getAsset
public Asset getAsset()
-
getChildren
public Set<Node> getChildren()
- Specified by:
getChildrenin interfaceNode- Returns:
- The child nodes of this node or, an empty set if it has no children or holds an asset. This method will never return null. The returned Set will be an immutable view.
-
addChild
public void addChild(Node node)
Adds a child to the Set of nodes. If already exists, nothing happens.- Parameters:
node- The Node that will be added as a child
-
removeChild
public void removeChild(Node node)
Removes a child from the Set of nodes. If it doesn't exists, nothing happens.- Parameters:
node- The Node that will be removed from the childs
-
-