public abstract class DefaultCellPathResolver extends AbstractCellPathResolver
| Modifier and Type | Field and Description |
|---|---|
static String |
REPOSITORIES_SECTION |
| Constructor and Description |
|---|
DefaultCellPathResolver() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.collect.ImmutableMap<CellName,AbsPath> |
bootstrapPathMapping(AbsPath root,
Config config) |
static DefaultCellPathResolver |
create(AbsPath root,
Config config)
Creates a DefaultCellPathResolver using the mappings in the provided
Config. |
static DefaultCellPathResolver |
create(AbsPath root,
Map<String,AbsPath> cellPaths,
CellNameResolver cellNameResolver,
NewCellPathResolver newCellPathResolver) |
Optional<String> |
getCanonicalCellName(Path cellPath)
Returns a cell name that can be used to refer to the cell at the given path.
|
abstract CellNameResolver |
getCellNameResolver()
Provides access to the
CellNameResolver for this cell. |
Optional<Path> |
getCellPath(Optional<String> cellName) |
abstract com.google.common.collect.ImmutableMap<String,AbsPath> |
getCellPathsByRootCellExternalName() |
com.google.common.collect.ImmutableMap<Path,String> |
getExternalNamesInRootCell()
This gives the names as they are specified in the root cell.
|
com.google.common.collect.ImmutableSortedSet<AbsPath> |
getKnownRoots() |
abstract NewCellPathResolver |
getNewCellPathResolver()
Provides access to the
NewCellPathResolver. |
com.google.common.collect.ImmutableMap<CellName,AbsPath> |
getPathMapping() |
abstract AbsPath |
getRoot() |
getCellPathOrThrow, getCellPathOrThrow, resolveCellRelativePathclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCanonicalCellName, getCurrentCellNamepublic static final String REPOSITORIES_SECTION
public abstract AbsPath getRoot()
public abstract com.google.common.collect.ImmutableMap<String,AbsPath> getCellPathsByRootCellExternalName()
public abstract CellNameResolver getCellNameResolver()
CellPathResolverCellNameResolver for this cell. This is to assist in migration
to the new name/path resolvers.public abstract NewCellPathResolver getNewCellPathResolver()
CellPathResolverNewCellPathResolver. This is to assist in migration to the new
name/path resolvers.@Value.Lazy public com.google.common.collect.ImmutableMap<Path,String> getExternalNamesInRootCell()
@Value.Lazy public com.google.common.collect.ImmutableMap<CellName,AbsPath> getPathMapping()
@Value.Lazy public com.google.common.collect.ImmutableSortedSet<AbsPath> getKnownRoots()
getKnownRoots in interface CellPathResolvergetKnownRoots in class AbstractCellPathResolverpublic static DefaultCellPathResolver create(AbsPath root, Map<String,AbsPath> cellPaths, CellNameResolver cellNameResolver, NewCellPathResolver newCellPathResolver)
public static DefaultCellPathResolver create(AbsPath root, Config config)
Config. This is
the preferred way to create a DefaultCellPathResolver.public static com.google.common.collect.ImmutableMap<CellName,AbsPath> bootstrapPathMapping(AbsPath root, Config config)
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 Optional<String> getCanonicalCellName(Path cellPath)
CellPathResolverReturns 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.