Commit b968bfca authored by Piotr Gawron's avatar Piotr Gawron
Browse files

drug constructor can take another drug as an input

parent c558e399
...@@ -3,19 +3,36 @@ ...@@ -3,19 +3,36 @@
var Annotation = require("./Annotation"); var Annotation = require("./Annotation");
var TargettingStructure = require("./TargettingStructure"); var TargettingStructure = require("./TargettingStructure");
/**
* @typedef {TargettingStructureOptions} DrugOptions
* @property {string[]} brandNames
* @property {Annotation[]} references
* @property {string[]} synonyms
* @property {string} description
* @property {string} bloodBrainBarrier
*/
/** /**
* *
* @param javaObject * @param {DrugOptions|Drug} javaObject
* @constructor * @constructor
*/ */
function Drug(javaObject) { function Drug(javaObject) {
TargettingStructure.call(this, javaObject); TargettingStructure.call(this, javaObject);
if (javaObject !== undefined) { if (javaObject !== undefined) {
this.setBrandNames(javaObject.brandNames); if (javaObject instanceof Drug) {
this.setReferences(javaObject.references); this.setBrandNames(javaObject.getBrandNames());
this.setSynonyms(javaObject.synonyms); this.setReferences(javaObject.getReferences());
this.setDescription(javaObject.description); this.setSynonyms(javaObject.getSynonyms());
this.setBloodBrainBarrier(javaObject.bloodBrainBarrier); this.setDescription(javaObject.getDescription());
this.setBloodBrainBarrier(javaObject.getBloodBrainBarrier());
} else {
this.setBrandNames(javaObject.brandNames);
this.setReferences(javaObject.references);
this.setSynonyms(javaObject.synonyms);
this.setDescription(javaObject.description);
this.setBloodBrainBarrier(javaObject.bloodBrainBarrier);
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment