ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

org.jboss.shrinkwrap.impl.base.path
Class BasicPath

java.lang.Object
  extended by 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

Constructor Summary
BasicPath()
          Creates a new Path representing the root context
BasicPath(ArchivePath 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(String context)
          Creates a new Path with the specified context
BasicPath(String basePath, ArchivePath context)
          Creates a new Path using the specified base and specified relative context.
BasicPath(String basePath, String context)
          Creates a new Path using the specified base and specified relative context.
 
Method Summary
 int compareTo(ArchivePath path)
          
 boolean equals(Object obj)
          
 String get()
          Obtains the context which this ArchivePath represents
 ArchivePath getParent()
          Obtains the parent of this Path, if exists, else null.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 -

BasicPath

public BasicPath(String basePath,
                 String 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 this ArchivePath represents

Specified by:
get in interface ArchivePath
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 interface ArchivePath
Returns:
See Also:
ArchivePath.getParent()

compareTo

public int compareTo(ArchivePath path)

Specified by:
compareTo in interface Comparable<ArchivePath>
See Also:
Comparable.compareTo(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.