Encapsulate the list of ignored subdirectories in an object.

This is the mechanical part of the change. It's not, strictly speaking, necessary, but given that the that set of path fragments will not be interpreted as a set of path fragments soon, I think it's better to be explicit.

An ancillary benefit is that now one can search for the new object to figure out which parts of the code handle the concept of "ignored subdirectories".

Progress towards #7093 .

RELNOTES: None.
PiperOrigin-RevId: 686046437
Change-Id: I4191297c9b1e5a6599d4c5f8eb2c80fae14ac220
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RecursivePkgKey.java b/src/main/java/com/google/devtools/build/lib/skyframe/RecursivePkgKey.java
index 3038da9..32e24ba 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RecursivePkgKey.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RecursivePkgKey.java
@@ -16,6 +16,7 @@
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
+import com.google.devtools.build.lib.cmdline.IgnoredSubdirectories;
 import com.google.devtools.build.lib.cmdline.RepositoryName;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
 import com.google.devtools.build.lib.skyframe.serialization.VisibleForSerialization;
@@ -36,13 +37,11 @@
 public class RecursivePkgKey {
   @VisibleForSerialization final RepositoryName repositoryName;
   @VisibleForSerialization final RootedPath rootedPath;
-  @VisibleForSerialization final ImmutableSet<PathFragment> excludedPaths;
+  @VisibleForSerialization final IgnoredSubdirectories excludedPaths;
 
   public RecursivePkgKey(
-      RepositoryName repositoryName,
-      RootedPath rootedPath,
-      ImmutableSet<PathFragment> excludedPaths) {
-    PathFragment.checkAllPathsAreUnder(excludedPaths, rootedPath.getRootRelativePath());
+      RepositoryName repositoryName, RootedPath rootedPath, IgnoredSubdirectories excludedPaths) {
+    Preconditions.checkArgument(excludedPaths.allPathsAreUnder(rootedPath.getRootRelativePath()));
     this.repositoryName = repositoryName;
     this.rootedPath = Preconditions.checkNotNull(rootedPath);
     this.excludedPaths = Preconditions.checkNotNull(excludedPaths);
@@ -56,7 +55,7 @@
     return rootedPath;
   }
 
-  public ImmutableSet<PathFragment> getExcludedPaths() {
+  public IgnoredSubdirectories getExcludedPaths() {
     return excludedPaths;
   }