Class DefaultCellPathResolver

    • Constructor Detail

      • DefaultCellPathResolver

        public DefaultCellPathResolver()
    • Method Detail

      • getRoot

        public abstract AbsPath getRoot()
      • getCellPathsByRootCellExternalName

        public abstract 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).
      • getCellNameResolver

        public abstract CellNameResolver getCellNameResolver()
        Description copied from interface: CellPathResolver
        Provides access to the CellNameResolver for this cell. This is to assist in migration to the new name/path resolvers.
      • getExternalNamesInRootCell

        @Lazy
        public com.google.common.collect.ImmutableMap<Path,​String> getExternalNamesInRootCell()
        This gives the names as they are specified in the root cell.
      • getPathMapping

        @Lazy
        public com.google.common.collect.ImmutableMap<CellName,​AbsPath> getPathMapping()
      • create

        public static DefaultCellPathResolver create​(AbsPath root,
                                                     Config config)
        Creates a DefaultCellPathResolver using the mappings in the provided Config. This is the preferred way to create a DefaultCellPathResolver.
      • bootstrapPathMapping

        public static com.google.common.collect.ImmutableMap<CellName,​AbsPath> bootstrapPathMapping​(AbsPath root,
                                                                                                          Config config)
      • 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.
      • 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.