public final class CellPathResolverView extends AbstractCellPathResolver
Views are used for non-root cells, to ensure that only the subset of cell names that the cell declares are visible within that cell.
Constructor and Description |
---|
CellPathResolverView(CellPathResolver delegate,
CellNameResolver cellNameResolver,
com.google.common.collect.ImmutableSet<String> declaredCellNames,
Path cellPath) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object another) |
Optional<String> |
getCanonicalCellName(Path cellPath)
Returns a cell name that can be used to refer to the cell at the given path.
|
CellNameResolver |
getCellNameResolver()
Provides access to the
CellNameResolver for this cell. |
Optional<Path> |
getCellPath(Optional<String> cellName) |
com.google.common.collect.ImmutableMap<String,AbsPath> |
getCellPathsByRootCellExternalName() |
NewCellPathResolver |
getNewCellPathResolver()
Provides access to the
NewCellPathResolver . |
int |
hashCode() |
getCellPathOrThrow, getCellPathOrThrow, getKnownRoots, resolveCellRelativePath
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getCanonicalCellName, getCurrentCellName
public CellPathResolverView(CellPathResolver delegate, CellNameResolver cellNameResolver, com.google.common.collect.ImmutableSet<String> declaredCellNames, Path cellPath)
public CellNameResolver getCellNameResolver()
CellPathResolver
CellNameResolver
for this cell. This is to assist in migration
to the new name/path resolvers.public NewCellPathResolver getNewCellPathResolver()
CellPathResolver
NewCellPathResolver
. This is to assist in migration to the new
name/path resolvers.public Optional<Path> getCellPath(Optional<String> cellName)
cellName
- name of cell, Optional.empty() for root cell.Optional.empty()
if the
cell name cannot be resolved.public com.google.common.collect.ImmutableMap<String,AbsPath> getCellPathsByRootCellExternalName()
public Optional<String> getCanonicalCellName(Path cellPath)
CellPathResolver
Returns Optional.empty()
if the path refers to the root cell. Returns the
lexicographically smallest name if the cell path has multiple names.
Note: this is not the inverse of CellPathResolver.getCellPath(Optional)
, which returns the current,
rather than the root, cell path if the cell name is empty.