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