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 MojoKey
26 extends ProjectKey
27 {
28 private String goal;
29
30 private String executionId;
31
32 private String phase;
33
34 public MojoKey( String groupId, String artifactId, String version, String goal, String executionId,
35 String lifeCyclePhase )
36 {
37 super( groupId, artifactId, version );
38 this.goal = goal;
39 this.executionId = executionId;
40 this.phase = lifeCyclePhase;
41 }
42
43 public String getGoal()
44 {
45 return goal;
46 }
47
48 public void setGoal( String goal )
49 {
50 this.goal = goal;
51 }
52
53 public String getExecutionId()
54 {
55 return executionId;
56 }
57
58 public void setExecutionId( String executionId )
59 {
60 this.executionId = executionId;
61 }
62
63 public String getPhase()
64 {
65 return phase;
66 }
67
68 public void setPhase( String phase )
69 {
70 this.phase = phase;
71 }
72
73 public String getFullId()
74 {
75 return super.getId() + ":" + getGoal() + ":" + getExecutionId();
76 }
77
78 public int hashCode()
79 {
80 final int prime = 31;
81 int result = super.hashCode();
82 result = prime * result + ( ( executionId == null ) ? 0 : executionId.hashCode() );
83 result = prime * result + ( ( goal == null ) ? 0 : goal.hashCode() );
84 result = prime * result + ( ( phase == null ) ? 0 : phase.hashCode() );
85 return result;
86 }
87
88 public final boolean equals( Object obj )
89 {
90 if ( this == obj )
91 return true;
92 if ( !super.equals( obj ) )
93 return false;
94 if ( getClass() != obj.getClass() )
95 return false;
96 MojoKey other = (MojoKey) obj;
97 if ( executionId == null )
98 {
99 if ( other.executionId != null )
100 return false;
101 }
102 else if ( !executionId.equals( other.executionId ) )
103 return false;
104 if ( goal == null )
105 {
106 if ( other.goal != null )
107 return false;
108 }
109 else if ( !goal.equals( other.goal ) )
110 return false;
111 if ( phase == null )
112 {
113 if ( other.phase != null )
114 return false;
115 }
116 else if ( !phase.equals( other.phase ) )
117 return false;
118 return true;
119 }
120
121 }