View Javadoc
1   package org.apache.maven.plugin.verifier;
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 java.util.ArrayList;
23  import java.util.List;
24  
25  import org.apache.maven.plugin.verifier.model.File;
26  
27  /**
28   * 
29   */
30  public class VerificationResult
31  {
32      private List<File> existenceFailures = new ArrayList<File>();
33  
34      private List<File> nonExistenceFailures = new ArrayList<File>();
35  
36      private List<File> contentFailures = new ArrayList<File>();
37  
38      /**
39       * @param file {@link File}
40       */
41      public void addExistenceFailure( File file )
42      {
43          existenceFailures.add( file );
44      }
45  
46      /**
47       * Added non existence failure.
48       * 
49       * @param file {@linke File}
50       */
51      public void addNonExistenceFailure( File file )
52      {
53          nonExistenceFailures.add( file );
54      }
55  
56      /**
57       * Add content failure.
58       * 
59       * @param file {@link File}
60       */
61      public void addContentFailure( File file )
62      {
63          contentFailures.add( file );
64      }
65  
66      /**
67       * @return {@link #existenceFailures}
68       */
69      public List<File> getExistenceFailures()
70      {
71          return existenceFailures;
72      }
73  
74      /**
75       * @return {@link #nonExistenceFailures}
76       */
77      public List<File> getNonExistenceFailures()
78      {
79          return nonExistenceFailures;
80      }
81  
82      /**
83       * @return {@link #contentFailures}
84       */
85      public List<File> getContentFailures()
86      {
87          return contentFailures;
88      }
89  
90      /**
91       * @return true if a failures exists false otherwise.
92       */
93      public boolean hasFailures()
94      {
95          return !getExistenceFailures().isEmpty() || !getNonExistenceFailures().isEmpty()
96              || !getContentFailures().isEmpty();
97      }
98  }