-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CreateNewProjectFromProjectBackupAction
- Loading branch information
Showing
3 changed files
with
241 additions
and
62 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
62 changes: 62 additions & 0 deletions
62
...ava/edu/stanford/bmir/protege/web/shared/icd/CreateNewProjectFromProjectBackupAction.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,62 @@ | ||
package edu.stanford.bmir.protege.web.shared.icd; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
import com.google.common.base.Objects; | ||
import edu.stanford.bmir.protege.web.shared.dispatch.Action; | ||
import edu.stanford.bmir.protege.web.shared.project.*; | ||
|
||
import static com.google.common.base.MoreObjects.toStringHelper; | ||
import static com.google.common.base.Preconditions.checkNotNull; | ||
|
||
@JsonTypeName("webprotege.projects.CreateNewProjectFromProjectBackup") | ||
public class CreateNewProjectFromProjectBackupAction implements Action<CreateNewProjectFromProjectBackupResult> { | ||
private ProjectId newProjectId; | ||
|
||
private NewProjectSettings newProjectSettings; | ||
|
||
/** | ||
* For serialization purposes only | ||
*/ | ||
private CreateNewProjectFromProjectBackupAction() { | ||
} | ||
|
||
@JsonCreator | ||
public CreateNewProjectFromProjectBackupAction(@JsonProperty("projectId") ProjectId newProjectId, | ||
@JsonProperty("newProjectSettings") NewProjectSettings newProjectSettings) { | ||
this.newProjectId = newProjectId; | ||
this.newProjectSettings = checkNotNull(newProjectSettings); | ||
} | ||
|
||
public ProjectId getNewProjectId() { | ||
return newProjectId; | ||
} | ||
|
||
public NewProjectSettings getNewProjectSettings() { | ||
return newProjectSettings; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(newProjectId, newProjectSettings); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == this) { | ||
return true; | ||
} | ||
if (!(obj instanceof CreateNewProjectFromProjectBackupAction)) { | ||
return false; | ||
} | ||
CreateNewProjectFromProjectBackupAction other = (CreateNewProjectFromProjectBackupAction) obj; | ||
return this.newProjectId.equals(other.newProjectId) && this.newProjectSettings.equals(other.newProjectSettings); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return toStringHelper("CreateNewProjectFromProjectBackupAction") | ||
.addValue(newProjectId) | ||
.addValue(newProjectSettings) | ||
.toString(); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...ava/edu/stanford/bmir/protege/web/shared/icd/CreateNewProjectFromProjectBackupResult.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,54 @@ | ||
package edu.stanford.bmir.protege.web.shared.icd; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
import com.google.common.base.Objects; | ||
import edu.stanford.bmir.protege.web.shared.dispatch.Result; | ||
import edu.stanford.bmir.protege.web.shared.project.*; | ||
|
||
import static com.google.common.base.MoreObjects.toStringHelper; | ||
import static com.google.common.base.Preconditions.checkNotNull; | ||
|
||
@JsonTypeName("webprotege.projects.CreateNewProjectFromProjectBackup") | ||
public class CreateNewProjectFromProjectBackupResult implements Result { | ||
|
||
private ProjectDetails projectDetails; | ||
|
||
/** | ||
* For serialization purposes only | ||
*/ | ||
private CreateNewProjectFromProjectBackupResult() { | ||
} | ||
|
||
public CreateNewProjectFromProjectBackupResult(ProjectDetails projectDetails) { | ||
this.projectDetails = checkNotNull(projectDetails); | ||
} | ||
|
||
public ProjectDetails getProjectDetails() { | ||
return projectDetails; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(projectDetails); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == this) { | ||
return true; | ||
} | ||
if (!(obj instanceof CreateNewProjectFromProjectBackupResult)) { | ||
return false; | ||
} | ||
CreateNewProjectFromProjectBackupResult other = (CreateNewProjectFromProjectBackupResult) obj; | ||
return this.projectDetails.equals(other.projectDetails); | ||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
return toStringHelper("CreateNewProjectFromProjectBackupResult") | ||
.addValue(projectDetails) | ||
.toString(); | ||
} | ||
} |