Class BasicPath
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.path.BasicPath
-
- All Implemented Interfaces:
java.lang.Comparable<ArchivePath>,ArchivePath
public class BasicPath extends java.lang.Object implements ArchivePath, java.lang.Comparable<ArchivePath>
A Path which may be optionally prefixed with some common namespace context at construction time. Thread-safe.- Version:
- $Revision: $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcontextThe context which this path represents; immutable so we're thread-safe.private static java.util.logging.LoggerlogLogger-
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(java.lang.String context)Creates a new Path with the specified contextBasicPath(java.lang.String basePath, java.lang.String context)Creates a new Path using the specified base and specified relative context.BasicPath(java.lang.String basePath, ArchivePath context)Creates a new Path using the specified base and specified relative context.BasicPath(ArchivePath basePath, java.lang.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(java.lang.Object obj)java.lang.Stringget()Obtains the context which thisArchivePathrepresentsArchivePathgetParent()Obtains the parent of this Path, if exists, else null.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
BasicPath
public BasicPath()
Creates a new Path representing the root context
-
BasicPath
public BasicPath(java.lang.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, java.lang.String context)
Creates a new Path using the specified base and specified relative context.- Parameters:
basePath-context-
-
BasicPath
public BasicPath(java.lang.String basePath, ArchivePath context)Creates a new Path using the specified base and specified relative context.- Parameters:
basePath-context-
-
BasicPath
public BasicPath(java.lang.String basePath, java.lang.String context)Creates a new Path using the specified base and specified relative context.- Parameters:
basePath-context-
-
-
Method Detail
-
get
public java.lang.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 interfacejava.lang.Comparable<ArchivePath>- See Also:
Comparable.compareTo(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-