public void onCurationDepthUpdate(Publication publication, CurationDepth oldDepth) { if (oldDepth == null){ publicationChangeLogger.log(Level.INFO, "The Curation depth has been initialised for the publication " + publication.toString()); } else if (publication.getCurationDepth() == null){ publicationChangeLogger.log(Level.INFO, "The Curation depth has been reset for the publication " + publication.toString()); } else { publicationChangeLogger.log(Level.INFO, "The Curation depth " + oldDepth + " has been updated with " + publication.getCurationDepth() + " in the publication " + publication.toString()); } }
CurationDepth depth1 = publication1.getCurationDepth(); CurationDepth depth2 = publication2.getCurationDepth();
protected void writeInteractionAnnotationTagsFrom(Publication pub) throws IOException { boolean isFirst = true; switch (pub.getCurationDepth()){ case IMEx: isFirst = false;
CurationDepth depth1 = publication1.getCurationDepth(); CurationDepth depth2 = publication2.getCurationDepth();
/** * * @param pub * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Publication pub){ if (unambiguousCuratedPublicationComparator == null){ unambiguousCuratedPublicationComparator = new UnambiguousCuratedPublicationComparator(); } if (pub == null){ return 0; } int hashcode = UnambiguousPublicationComparator.hashCode(pub); hashcode = 31*hashcode + pub.getCurationDepth().hashCode(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(pub.getSource()); hashcode = 31*hashcode + (pub.getReleasedDate() != null ? pub.getReleasedDate().hashCode() : 0); return hashcode; } }
/*** * This method will copy properties of publication source in publication target and will override all the other properties of Target publication. * This method will ignore experiments * @param source * @param target */ public static void copyAndOverridePublicationProperties(Publication source, Publication target){ if (source != null && target != null){ target.setCurationDepth(source.getCurationDepth()); target.setJournal(source.getJournal()); target.setReleasedDate(source.getReleasedDate()); target.setTitle(source.getTitle()); target.setPublicationDate(source.getPublicationDate()); target.setSource(source.getSource()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getAuthors().clear(); target.getAuthors().addAll(source.getAuthors()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); } }