public static <T extends CvObject> T createCvObject(Institution institution, Class<T> cvClass, String primaryId, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); CvObjectXref idXref = XrefUtils.createIdentityXrefPsiMi(cv, primaryId); cv.addXref(idXref); return cv; } }
public static <T extends CvObject> T createCvObject(Institution institution, Class<T> cvClass, String miIdentifier, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); cv.setIdentifier(miIdentifier); if (miIdentifier != null) { CvObjectXref idXref = XrefUtils.createIdentityXrefPsiMi(cv, miIdentifier); cv.addXref(idXref); idXref.prepareParentMi(); } return cv; }
public static <T extends CvObject> T createCvObject(Institution institution, Class<T> cvClass, String miIdentifier, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); cv.setIdentifier(miIdentifier); if (miIdentifier != null) { CvObjectXref idXref = XrefUtils.createIdentityXrefPsiMi(cv, miIdentifier); cv.addXref(idXref); idXref.prepareParentMi(); } return cv; }
public static <T extends CvObject> T createIntactCvObject(Institution institution, Class<T> cvClass, String intactId, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); cv.setIdentifier(intactId); if (intactId != null) { CvObjectXref idXref = XrefUtils.createIdentityXrefIntact(cv, intactId); cv.addXref(idXref); idXref.prepareParentMi(); } return cv; }
public static <T extends CvObject> T createIntactCvObject(Institution institution, Class<T> cvClass, String intactId, String shortLabel) { T cv = ClassUtils.newInstance(cvClass); cv.setOwner(institution); cv.setShortLabel(shortLabel); cv.setIdentifier(intactId); if (intactId != null) { CvObjectXref idXref = XrefUtils.createIdentityXrefIntact(cv, intactId); cv.addXref(idXref); idXref.prepareParentMi(); } return cv; }