1 package com.soebes.maven.extensions;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 class ProjectMojo
26 {
27 private ProjectKey project;
28
29 private MojoKey mojo;
30
31 public ProjectMojo( ProjectKey project, MojoKey mojo )
32 {
33 super();
34 this.project = project;
35 this.mojo = mojo;
36 }
37
38 public ProjectKey getProject()
39 {
40 return project;
41 }
42
43 public void setProject( ProjectKey project )
44 {
45 this.project = project;
46 }
47
48 public MojoKey getMojo()
49 {
50 return mojo;
51 }
52
53 public void setMojo( MojoKey mojo )
54 {
55 this.mojo = mojo;
56 }
57
58 @Override
59 public int hashCode()
60 {
61 final int prime = 31;
62 int result = 1;
63 result = prime * result + ( ( mojo == null ) ? 0 : mojo.hashCode() );
64 result = prime * result + ( ( project == null ) ? 0 : project.hashCode() );
65 return result;
66 }
67
68 public String getId()
69 {
70 String s1 = getMojo().getGroupId() + ":" + getMojo().getArtifactId() + ":" + getMojo().getVersion() + ":"
71 + getMojo().getGoal() + " (" + getMojo().getExecutionId() + ":" + getMojo().getPhase() + ")";
72 String s2 = getProject().getGroupId() + ":" + getProject().getArtifactId() + ":" + getProject().getVersion();
73 return s1 + " @ " + s2;
74 }
75
76 @Override
77 public boolean equals( Object obj )
78 {
79 if ( this == obj )
80 return true;
81 if ( obj == null )
82 return false;
83 if ( getClass() != obj.getClass() )
84 return false;
85 ProjectMojo other = (ProjectMojo) obj;
86 if ( mojo == null )
87 {
88 if ( other.mojo != null )
89 return false;
90 }
91 else if ( !mojo.equals( other.mojo ) )
92 return false;
93 if ( project == null )
94 {
95 if ( other.project != null )
96 return false;
97 }
98 else if ( !project.equals( other.project ) )
99 return false;
100 return true;
101 }
102
103 }