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 ProjectGoal
26 {
27 private final ProjectKey project;
28
29 private final GoalKey mojo;
30
31 public ProjectGoal( ProjectKey project, GoalKey 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 GoalKey getMojo()
44 {
45 return mojo;
46 }
47
48 @Override
49 public final int hashCode()
50 {
51 final int prime = 31;
52 int result = 1;
53 result = prime * result + ( ( mojo == null ) ? 0 : mojo.hashCode() );
54 result = prime * result + ( ( project == null ) ? 0 : project.hashCode() );
55 return result;
56 }
57
58 public String getId()
59 {
60 return getMojo().getGroupId() + ":" + getMojo().getArtifactId() + ":" + getMojo().getVersion() + ":"
61 + getMojo().getGoal() + " (" + getMojo().getExecutionId() + ")";
62 }
63
64 @Override
65 public final boolean equals( Object obj )
66 {
67 if ( this == obj )
68 {
69 return true;
70 }
71 if ( obj == null )
72 {
73 return false;
74 }
75 if ( !( obj instanceof ProjectGoal ) )
76 {
77 return false;
78 }
79 ProjectGoal other = (ProjectGoal) obj;
80 if ( mojo == null )
81 {
82 if ( other.mojo != null )
83 {
84 return false;
85 }
86 }
87 else if ( !mojo.equals( other.mojo ) )
88 {
89 return false;
90 }
91 if ( project == null )
92 {
93 if ( other.project != null )
94 {
95 return false;
96 }
97 }
98 else if ( !project.equals( other.project ) )
99 {
100 return false;
101 }
102 return true;
103 }
104
105 }