@Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final ExperimentDescription that = ( ExperimentDescription ) o; if ( id != that.id ) { return false; } if ( bibref != null ? !bibref.equals( that.bibref ) : that.bibref != null ) { return false; } if ( interactionDetectionMethod != null ? !interactionDetectionMethod.equals( that.interactionDetectionMethod ) : that.interactionDetectionMethod != null ) { return false; } return true; }
@Override public int hashCode() { int result; result = id; result = 29 * result + ( bibref != null ? bibref.hashCode() : 0 ); result = 29 * result + ( interactionDetectionMethod != null ? interactionDetectionMethod.hashCode() : 0 ); return result; } }
private Set<EvidenceCodeVocabulary> getEvidenceCodes(ExperimentDescription experimentDescription) { Set<EvidenceCodeVocabulary> toReturn = new HashSet<EvidenceCodeVocabulary>(); // get experiment methods Set<CvType> cvTypeSet = new HashSet<CvType>(3); //skip if "unspecified method" (MI:0686) is the interaction detection method if(experimentDescription.getInteractionDetectionMethod() != null && !"MI:0686".equalsIgnoreCase(experimentDescription.getInteractionDetectionMethod().getXref().getPrimaryRef().getId())) cvTypeSet.add(experimentDescription.getInteractionDetectionMethod()); if(experimentDescription.getParticipantIdentificationMethod() != null && !"MI:0686".equalsIgnoreCase(experimentDescription.getParticipantIdentificationMethod().getXref().getPrimaryRef().getId())) cvTypeSet.add(experimentDescription.getParticipantIdentificationMethod()); if(experimentDescription.getFeatureDetectionMethod() != null && !"MI:0686".equalsIgnoreCase(experimentDescription.getFeatureDetectionMethod().getXref().getPrimaryRef().getId())) cvTypeSet.add(experimentDescription.getFeatureDetectionMethod()); // create openControlledVocabulary objects for each detection method for (CvType cvtype : cvTypeSet) { EvidenceCodeVocabulary ecv = findOrCreateControlledVocabulary(cvtype, EvidenceCodeVocabulary.class); if (ecv != null) toReturn.add(ecv); } return toReturn; }