Package org.jboss.shrinkwrap.impl.base
Class NodeImpl
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.NodeImpl
-
-
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 void
addChild(Node node)
Adds a child to the Set of nodes.boolean
equals(java.lang.Object obj)
Asset
getAsset()
java.util.Set<Node>
getChildren()
ArchivePath
getPath()
int
hashCode()
void
removeChild(Node node)
Removes a child from the Set of nodes.java.lang.String
toString()
-
-
-
Field Detail
-
path
private ArchivePath path
The path of this node inside theArchive
-
asset
private Asset asset
The asset this node holds.
-
children
private java.util.Set<Node> children
The children nodes.
-
-
Constructor Detail
-
NodeImpl
public NodeImpl(ArchivePath path)
Constructor This constructor will create a directory Node with the specified path.- Parameters:
path
- TheArchivePath
this 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
- TheArchivePath
this Node is placed within theArchive
asset
- TheAsset
that this Node holds.
-
-
Method Detail
-
getPath
public ArchivePath getPath()
-
getAsset
public Asset getAsset()
-
getChildren
public java.util.Set<Node> getChildren()
- Specified by:
getChildren
in 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
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-