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.String
context
The context which this path represents; immutable so we're thread-safe.private static java.util.logging.Logger
log
Logger-
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 int
compareTo(ArchivePath path)
boolean
equals(java.lang.Object obj)
java.lang.String
get()
Obtains the context which thisArchivePath
representsArchivePath
getParent()
Obtains the parent of this Path, if exists, else null.int
hashCode()
java.lang.String
toString()
-
-
-
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 thisArchivePath
represents- Specified by:
get
in 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:
getParent
in interfaceArchivePath
- Returns:
- See Also:
ArchivePath.getParent()
-
compareTo
public int compareTo(ArchivePath path)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ArchivePath>
- See Also:
Comparable.compareTo(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-