1   package org.apache.maven.model.building;
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  import org.apache.maven.model.InputLocation;
23  import org.apache.maven.model.building.ModelProblem.Severity;
24  import org.apache.maven.model.building.ModelProblem.Version;
25  
26  
27  
28  
29  
30  
31  public final class ModelProblemCollectorRequest
32  {
33  
34      private final ModelProblem.Severity severity;
35      private final ModelProblem.Version version;
36      private Exception exception;
37      private String message;
38      private InputLocation location;
39      
40      
41  
42  
43  
44  
45      public ModelProblemCollectorRequest( Severity severity, Version version )
46      {
47          this.severity = severity;
48          this.version = version;
49          if ( severity == null )
50          {
51              throw new IllegalStateException( "No severity declared" );
52          }
53          if ( version == null )
54          {
55              throw new IllegalStateException( "No version declared." );
56          }
57      }
58  
59      public Severity getSeverity()
60      {
61          return severity;
62      }
63  
64      public Version getVersion()
65      {
66          return version;
67      }
68  
69      public Exception getException()
70      {
71          return exception;
72      }
73  
74      public ModelProblemCollectorRequest setException( Exception exception )
75      {
76          this.exception = exception;
77          return this;
78      }
79  
80      public String getMessage()
81      {
82          return message;
83      }
84  
85      public ModelProblemCollectorRequest setMessage( String message )
86      {
87          this.message = message;
88          return this;
89      }
90  
91      public InputLocation getLocation()
92      {
93          return location;
94      }
95  
96      public ModelProblemCollectorRequest setLocation( InputLocation location )
97      {
98          this.location = location;
99          return this;
100     }
101 }