Class BasicPath
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.path.BasicPath
-
- All Implemented Interfaces:
Comparable<ArchivePath>,ArchivePath
public class BasicPath extends Object implements ArchivePath, Comparable<ArchivePath>
A Path which may be optionally prefixed with some common namespace context at construction time. Thread-safe.- Version:
- $Revision: $
- Author:
- ALR, Aslak Knutsen
-
-
Field Summary
-
Fields inherited from interface org.jboss.shrinkwrap.api.ArchivePath
SEPARATOR, SEPARATOR_STRING
-
-
Constructor Summary
Constructors Constructor Description BasicPath()Creates a new Path representing the root contextBasicPath(String context)Creates a new Path with the specified contextBasicPath(String basePath, String context)Creates a new Path using the specified base and specified relative context.BasicPath(String basePath, ArchivePath context)Creates a new Path using the specified base and specified relative context.BasicPath(ArchivePath basePath, String context)Creates a new Path using the specified base and specified relative context.BasicPath(ArchivePath basePath, ArchivePath context)Creates a new Path using the specified base and specified relative context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ArchivePath path)booleanequals(Object obj)Stringget()Obtains the context which thisArchivePathrepresentsArchivePathgetParent()Obtains the parent of this Path, if exists, else null.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
BasicPath
public BasicPath()
Creates a new Path representing the root context
-
BasicPath
public BasicPath(String context)
Creates a new Path with the specified context- Parameters:
context- The context which this path represents. Null or blank represents the root. Relative paths will be adjusted to absolute form.
-
BasicPath
public BasicPath(ArchivePath basePath, ArchivePath context)
Creates a new Path using the specified base and specified relative context.- Parameters:
basePath-context-
-
BasicPath
public BasicPath(ArchivePath basePath, String context)
Creates a new Path using the specified base and specified relative context.- Parameters:
basePath-context-
-
BasicPath
public BasicPath(String basePath, ArchivePath context)
Creates a new Path using the specified base and specified relative context.- Parameters:
basePath-context-
-
-
Method Detail
-
get
public String get()
Obtains the context which thisArchivePathrepresents- Specified by:
getin interfaceArchivePath- Returns:
- See Also:
ArchivePath.get()
-
getParent
public ArchivePath getParent()
Obtains the parent of this Path, if exists, else null. For instance if the Path is "/my/path", the parent will be "/my". Each call will result in a new object reference, though subsequent calls upon the same Path will be equal by value.- Specified by:
getParentin interfaceArchivePath- Returns:
- See Also:
ArchivePath.getParent()
-
compareTo
public int compareTo(ArchivePath path)
- Specified by:
compareToin interfaceComparable<ArchivePath>- See Also:
Comparable.compareTo(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
-