View Javadoc

1   package org.apache.maven.plugin.linkcheck.validation;
2   
3   import java.io.Serializable;
4   
5   /* ====================================================================
6    *   Licensed to the Apache Software Foundation (ASF) under one or more
7    *   contributor license agreements.  See the NOTICE file distributed with
8    *   this work for additional information regarding copyright ownership.
9    *   The ASF licenses this file to You under the Apache License, Version 2.0
10   *   (the "License"); you may not use this file except in compliance with
11   *   the License.  You may obtain a copy of the License at
12   *
13   *       http://www.apache.org/licenses/LICENSE-2.0
14   *
15   *   Unless required by applicable law or agreed to in writing, software
16   *   distributed under the License is distributed on an "AS IS" BASIS,
17   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   *   See the License for the specific language governing permissions and
19   *   limitations under the License.
20   * ====================================================================
21   */
22  
23  /**
24   * <p>
25   * This class is used to return status responses from the validation handlers. A persistent result means that it can be
26   * stored in the persistent cache and used across runs.
27   * </p>
28   * 
29   * @author <a href="mailto:bwalding@apache.org">Ben Walding</a>
30   * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
31   * @version $Id: LinkValidationResult.java 532339 2007-04-25 12:28:56Z ltheussl $
32   */
33  public class LinkValidationResult implements Serializable
34  {
35      /**
36       * 
37       */
38      private static final long serialVersionUID = -8346824125135406813L;
39  
40      public static final int NOTMINE = 0;
41  
42      public static final int ERROR = 1;
43  
44      public static final int VALID = 2;
45  
46      public static final int UNKNOWN = 3;
47  
48      public static final int WARNING = 4;
49  
50      private final boolean persistent;
51  
52      private final int status;
53  
54      private final String errorMessage;
55  
56      public boolean isPersistent()
57      {
58          return this.persistent;
59      }
60  
61      /**
62       * Returns the status.
63       * 
64       * @return int
65       */
66      public int getStatus()
67      {
68          return this.status;
69      }
70  
71      /**
72       * @return Returns the errorMessage.
73       */
74      public String getErrorMessage()
75      {
76          return this.errorMessage;
77      }
78  
79      public LinkValidationResult( int status, boolean persistent, String errorMessage )
80      {
81          this.status = status;
82          this.persistent = persistent;
83          this.errorMessage = errorMessage;
84      }
85  
86      /*
87       * (non-Javadoc)
88       * 
89       * @see java.lang.Object#toString()
90       */
91      public String toString()
92      {
93          return this.persistent + "/" + this.status + "/" + this.errorMessage;
94      }
95  
96  }