This repository has been archived by the owner on Mar 15, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#maven.buildNumber.plugin properties file | ||
#Tue Dec 11 17:18:39 CET 2012 | ||
buildNumber=68 | ||
#Wed Dec 19 00:17:10 CET 2012 | ||
buildNumber=73 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/name/pehl/karaka/server/activity/entity/SameActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package name.pehl.karaka.server.activity.entity; | ||
|
||
import name.pehl.karaka.server.project.entity.Project; | ||
|
||
/** | ||
* Compares activities by name, description and project instead by id. Can be used as key in maps to filter | ||
* activities. | ||
* @author Harald Pehl | ||
*/ | ||
public class SameActivity | ||
{ | ||
private final String name; | ||
private final String description; | ||
private final Project project; | ||
|
||
|
||
public SameActivity(final Activity activity) | ||
{ | ||
this.name = activity.getName(); | ||
this.description = activity.getDescription(); | ||
this.project = activity.getProject() != null ? activity.getProject().get() : null; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) | ||
{ | ||
if (this == o) { return true; } | ||
if (!(o instanceof SameActivity)) { return false; } | ||
|
||
SameActivity that = (SameActivity) o; | ||
|
||
if (!name.equals(that.name)) { return false; } | ||
if (description != null ? !description.equals(that.description) : that.description != null) { return false; } | ||
if (project != null ? !project.equals(that.project) : that.project != null) { return false; } | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
int result = name.hashCode(); | ||
result = 31 * result + (description != null ? description.hashCode() : 0); | ||
result = 31 * result + (project != null ? project.hashCode() : 0); | ||
return result; | ||
} | ||
} |