View Javadoc
1   package org.apache.maven.surefire.booter;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import javax.annotation.Nonnull;
23  import java.io.File;
24  import java.util.Collection;
25  import java.util.List;
26  
27  import static java.util.Collections.unmodifiableCollection;
28  import static java.util.Collections.unmodifiableList;
29  
30  /**
31   * Jigsaw class-path and module-path.
32   *
33   * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
34   * @since 2.21.0.Jigsaw
35   */
36  public final class ModularClasspath
37  {
38      private final File moduleDescriptor;
39      private final List<String> modulePath;
40      private final Collection<String> packages;
41      private final File patchFile;
42  
43      public ModularClasspath( @Nonnull File moduleDescriptor, @Nonnull List<String> modulePath,
44                               @Nonnull Collection<String> packages,
45                               @Nonnull File patchFile )
46      {
47          this.moduleDescriptor = moduleDescriptor;
48          this.modulePath = modulePath;
49          this.packages = packages;
50          this.patchFile = patchFile;
51      }
52  
53      @Nonnull
54      public File getModuleDescriptor()
55      {
56          return moduleDescriptor;
57      }
58  
59      @Nonnull
60      public List<String> getModulePath()
61      {
62          return unmodifiableList( modulePath );
63      }
64  
65      @Nonnull
66      public Collection<String> getPackages()
67      {
68          return unmodifiableCollection( packages );
69      }
70  
71      @Nonnull
72      public File getPatchFile()
73      {
74          return patchFile;
75      }
76  }