Package com.facebook.buck.core.cell
Class CellPathResolverView
- java.lang.Object
-
- com.facebook.buck.core.cell.AbstractCellPathResolver
-
- com.facebook.buck.core.cell.CellPathResolverView
-
- All Implemented Interfaces:
CellPathResolver
public final class CellPathResolverView extends AbstractCellPathResolver
View of a subset of cells of a cell path resolver.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 Summary
Constructors Constructor Description CellPathResolverView(CellPathResolver delegate, CellNameResolver cellNameResolver, com.google.common.collect.ImmutableSet<String> declaredCellNames, Path cellPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theCellNameResolver
for this cell.Optional<Path>
getCellPath(Optional<String> cellName)
com.google.common.collect.ImmutableMap<String,AbsPath>
getCellPathsByRootCellExternalName()
NewCellPathResolver
getNewCellPathResolver()
Provides access to theNewCellPathResolver
.int
hashCode()
-
Methods inherited from class com.facebook.buck.core.cell.AbstractCellPathResolver
getCellPathOrThrow, getCellPathOrThrow, getKnownRoots, resolveCellRelativePath
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.facebook.buck.core.cell.CellPathResolver
getCanonicalCellName, getCurrentCellName
-
-
-
-
Constructor Detail
-
CellPathResolverView
public CellPathResolverView(CellPathResolver delegate, CellNameResolver cellNameResolver, com.google.common.collect.ImmutableSet<String> declaredCellNames, Path cellPath)
-
-
Method Detail
-
getCellNameResolver
public CellNameResolver getCellNameResolver()
Description copied from interface:CellPathResolver
Provides access to theCellNameResolver
for this cell. This is to assist in migration to the new name/path resolvers.
-
getNewCellPathResolver
public NewCellPathResolver getNewCellPathResolver()
Description copied from interface:CellPathResolver
Provides access to theNewCellPathResolver
. This is to assist in migration to the new name/path resolvers.
-
getCellPath
public Optional<Path> getCellPath(Optional<String> cellName)
- Parameters:
cellName
- name of cell, Optional.empty() for root cell.- Returns:
- Absolute path to the physical location of the cell, or
Optional.empty()
if the cell name cannot be resolved.
-
getCellPathsByRootCellExternalName
public com.google.common.collect.ImmutableMap<String,AbsPath> getCellPathsByRootCellExternalName()
- Returns:
- absolute paths to all cells this resolver knows about. The key is the name of the cell in the root cell's config (this is not necessarily the canonical name).
-
getCanonicalCellName
public Optional<String> getCanonicalCellName(Path cellPath)
Description copied from interface:CellPathResolver
Returns a cell name that can be used to refer to the cell at the given path.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.
-
-