-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flatten Molecule so all fields are deserialized
- Loading branch information
1 parent
283009b
commit d2f228c
Showing
11 changed files
with
316 additions
and
326 deletions.
There are no files selected for viewing
357 changes: 175 additions & 182 deletions
357
...a/nl/esciencecenter/e3dchem/knime/molviewer/pharmacophores/PharmacophoresViewerModel.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
41 changes: 0 additions & 41 deletions
41
...src/main/java/nl/esciencecenter/e3dchem/knime/molviewer/server/api/AnonymousMolecule.java
This file was deleted.
Oops, something went wrong.
77 changes: 43 additions & 34 deletions
77
server/src/main/java/nl/esciencecenter/e3dchem/knime/molviewer/server/api/Molecule.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 |
---|---|---|
@@ -1,41 +1,50 @@ | ||
package nl.esciencecenter.e3dchem.knime.molviewer.server.api; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
|
||
public class Molecule extends AnonymousMolecule { | ||
public Molecule(String data, String format) { | ||
super(data, format); | ||
} | ||
|
||
public Molecule() { | ||
super(); | ||
} | ||
|
||
private static final long serialVersionUID = 8195661028979524114L; | ||
|
||
@ApiModelProperty(required = true, value = "Identifier") | ||
public String id; | ||
@ApiModelProperty(required = true, value = "Label") | ||
public String label; | ||
|
||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
final Molecule other = (Molecule) obj; | ||
return Objects.equals(this.id, other.id) && Objects.equals(this.label, other.label) | ||
&& Objects.equals(this.format, other.format) && Objects.equals(this.data, other.data); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, label, format, data); | ||
} | ||
public class Molecule implements Serializable { | ||
public Molecule(String data, String format) { | ||
this.data = data; | ||
this.format = format; | ||
} | ||
|
||
public Molecule() { | ||
super(); | ||
} | ||
|
||
private static final long serialVersionUID = 8195661028979524114L; | ||
|
||
@ApiModelProperty(required = true, value = "Data format", allowableValues = "mol2, pdb, phar, sdf") | ||
public String format = null; | ||
@ApiModelProperty(required = true, value = "Data of molecule aka atoms/bonds in specified format") | ||
public String data = null; | ||
@ApiModelProperty(required = false, value = "Identifier") | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public String id = null; | ||
@ApiModelProperty(required = false, value = "Label") | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public String label = null; | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
final Molecule other = (Molecule) obj; | ||
return Objects.equals(this.id, other.id) && Objects.equals(this.label, other.label) | ||
&& Objects.equals(this.format, other.format) && Objects.equals(this.data, other.data); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, label, format, data); | ||
} | ||
} |
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
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
49 changes: 0 additions & 49 deletions
49
.../src/java/nl/esciencecenter/e3dchem/knime/molviewer/server/api/AnonymousMoleculeTest.java
This file was deleted.
Oops, something went wrong.
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