View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.buildcache;
20  
21  import java.io.File;
22  import java.nio.file.Path;
23  import java.util.List;
24  
25  import org.apache.maven.plugin.Mojo;
26  import org.apache.maven.plugin.MojoExecutionException;
27  import org.apache.maven.plugin.MojoFailureException;
28  import org.apache.maven.plugin.logging.Log;
29  
30  public class TestMojo implements Mojo {
31  
32      private boolean bool;
33      private int primitive;
34      private File file;
35      private Path path;
36      private List<String> list;
37      private String[] array;
38  
39      private Object anyObject;
40      private final Object nullObject = null;
41  
42      public TestMojo() {}
43  
44      public TestMojo(boolean bool, int primitive, File file, Path path, List<String> list, String[] array) {
45  
46          this.bool = bool;
47          this.primitive = primitive;
48          this.file = file;
49          this.path = path;
50          this.list = list;
51          this.array = array;
52      }
53  
54      public static TestMojo create(
55              boolean bool, int primitive, File file, Path path, List<String> list, String[] array) {
56          return new TestMojo(bool, primitive, file, path, list, array);
57      }
58  
59      public boolean isBool() {
60          return bool;
61      }
62  
63      public void setBool(boolean bool) {
64          this.bool = bool;
65      }
66  
67      public int getPrimitive() {
68          return primitive;
69      }
70  
71      public void setPrimitive(int primitive) {
72          this.primitive = primitive;
73      }
74  
75      public File getFile() {
76          return file;
77      }
78  
79      public void setFile(File file) {
80          this.file = file;
81      }
82  
83      public Path getPath() {
84          return path;
85      }
86  
87      public void setPath(Path path) {
88          this.path = path;
89      }
90  
91      public List<String> getList() {
92          return list;
93      }
94  
95      public void setList(List<String> list) {
96          this.list = list;
97      }
98  
99      public String[] getArray() {
100         return array;
101     }
102 
103     public void setArray(String[] array) {
104         this.array = array;
105     }
106 
107     public Object getAnyObject() {
108         return anyObject;
109     }
110 
111     public void setAnyObject(Object anyObject) {
112         this.anyObject = anyObject;
113     }
114 
115     @Override
116     public void execute() throws MojoExecutionException, MojoFailureException {
117         // do nothing
118     }
119 
120     @Override
121     public void setLog(Log log) {
122         // do nothing
123     }
124 
125     @Override
126     public Log getLog() {
127         // do nothing
128         return null;
129     }
130 }