org.modeshape.jcr.value

## Class WorkspaceAndPath

- java.lang.Object
- - org.modeshape.jcr.value.WorkspaceAndPath

-     @Immutable
      public final class WorkspaceAndPath
      extends Object

  A path within a given workspace.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WorkspaceAndPath(String workspaceName, Path path)` Create a new combination of a path within a named workspace.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `Path` | `getPath()` Get the path.
    `String` | `getWorkspaceName()` Get the workspace name.
    `int` | `hashCode()`
    `String` | `toString()`
    `WorkspaceAndPath` | `withPath(Path path)` Create a new instance that contains the current workspace name but which uses the supplied path.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### WorkspaceAndPath

          public WorkspaceAndPath(String workspaceName,
                          Path path)

      Create a new combination of a path within a named workspace.
      Parameters:
        `workspaceName` - the workspace name; may not be null
        `path` - the path; may not be null

  - ### Method Detail

    - #### getPath

          public Path getPath()

      Get the path.
      Returns:
        the path; never null

    - #### getWorkspaceName

          public String getWorkspaceName()

      Get the workspace name.
      Returns:
        the workspace name; never null

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### withPath

          public WorkspaceAndPath withPath(Path path)

      Create a new instance that contains the current workspace name but which uses the supplied path.
      Parameters:
        `path` - the new path
      Returns:
        the new WorkspaceAndPath instance, or this instance only if the supplied path is the same Path object already used by this instance; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.