/** * This method is an alternative equals to the CvObject.equals method, that basically checks * on the MI identifiers and then of the short label if the first check returns false * * @param cv1 One of the CvObjects * @param cv2 The other CvObject * @return True if (A) the MI are the same or (B) the short labels are the same in case A has failed * @since 1.8.0 */ public static boolean areEqual(CvObject cv1, CvObject cv2) { return areEqual(cv1, cv2, false); }
/** * This method is an alternative equals to the CvObject.equals method, that basically checks * on the MI identifiers and then of the short label if the first check returns false * * @param cv1 One of the CvObjects * @param cv2 The other CvObject * @return True if (A) the MI are the same or (B) the short labels are the same in case A has failed * @since 1.8.0 */ public static boolean areEqual(CvObject cv1, CvObject cv2) { return areEqual(cv1, cv2, false); }
protected boolean areCvObjectsEqual(CvObject source, CvObject target) { return CvObjectUtils.areEqual(source, target, true); }
protected boolean areCvObjectsEqual(CvObject source, CvObject target) { return CvObjectUtils.areEqual(source, target, true); }
if (!CvObjectUtils.areEqual(cvTopic, annotation.getCvTopic()) ) { return false;
if (!CvObjectUtils.areEqual(cvTopic, annotation.getCvTopic()) ) { return false;
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Xref)) return false; if (!super.equals(o)) { return false; } final Xref xref = (Xref) o; if (!getClass().equals(xref.getClass())) return false; if (!StringUtils.equals(getPrimaryId(), xref.getPrimaryId())) return false; if (!(cvDatabase == null && xref.getCvDatabase() == null)) { if (cvDatabase != null && !CvObjectUtils.areEqual(cvDatabase, xref.getCvDatabase())) { return false; } else if (cvDatabase == null) { return false; } } if (!(cvXrefQualifier == null && xref.getCvXrefQualifier() == null)) { if (cvXrefQualifier != null && !CvObjectUtils.areEqual(cvXrefQualifier, xref.getCvXrefQualifier())) { return false; } else if (cvXrefQualifier == null) { return false; } } return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Xref)) return false; if (!super.equals(o)) { return false; } final Xref xref = (Xref) o; if (!getClass().equals(xref.getClass())) return false; if (!StringUtils.equals(getPrimaryId(), xref.getPrimaryId())) return false; if (!(cvDatabase == null && xref.getCvDatabase() == null)) { if (cvDatabase != null && !CvObjectUtils.areEqual(cvDatabase, xref.getCvDatabase())) { return false; } else if (cvDatabase == null) { return false; } } if (!(cvXrefQualifier == null && xref.getCvXrefQualifier() == null)) { if (cvXrefQualifier != null && !CvObjectUtils.areEqual(cvXrefQualifier, xref.getCvXrefQualifier())) { return false; } else if (cvXrefQualifier == null) { return false; } } return true; }
public static boolean sameAlias( Alias a1, Alias a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getName(), a2.getName() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvAliasType(), a2.getCvAliasType() ) ) { return false; } return true; }
public static boolean sameAlias( Alias a1, Alias a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getName(), a2.getName() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvAliasType(), a2.getCvAliasType() ) ) { return false; } return true; }
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) { return false; } return true; }
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) { return false; } return true; }
public static boolean sameXref( Xref x1, Xref x2 ) { if (x1.getAc() != null && x2.getAc() != null) { return x1.getAc().equals(x2.getAc()); } if ( !same( x1.getPrimaryId(), x2.getPrimaryId() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvDatabase(), x2.getCvDatabase() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvXrefQualifier(), x2.getCvXrefQualifier() ) ) { return false; } if ( !same( x1.getSecondaryId(), x2.getSecondaryId() ) ) { return false; } if ( !same( x1.getDbRelease(), x2.getDbRelease() ) ) { return false; } return true; }
public static boolean sameXref( Xref x1, Xref x2 ) { if (x1.getAc() != null && x2.getAc() != null) { return x1.getAc().equals(x2.getAc()); } if ( !same( x1.getPrimaryId(), x2.getPrimaryId() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvDatabase(), x2.getCvDatabase() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvXrefQualifier(), x2.getCvXrefQualifier() ) ) { return false; } if ( !same( x1.getSecondaryId(), x2.getSecondaryId() ) ) { return false; } if ( !same( x1.getDbRelease(), x2.getDbRelease() ) ) { return false; } return true; }