/*** * This method will copy properties of Feature source in Feature target and will override all the other properties of Target feature. * Only the participant is not copied * @param source * @param target */ public static void copyAndOverrideBasicFeaturesProperties(Feature source, Feature target){ if (source != null && target != null){ target.setShortName(source.getShortName()); target.setFullName(source.getFullName()); target.setType(source.getType()); target.setRole(source.getRole()); // copy collections target.getAliases().clear(); target.getAliases().addAll(source.getAliases()); target.getLinkedFeatures().clear(); target.getLinkedFeatures().addAll(source.getLinkedFeatures()); target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getRanges().clear(); target.getRanges().addAll(source.getRanges()); } } }
else if (!feature1.getIdentifiers().isEmpty() && !feature2.getIdentifiers().isEmpty()){ if (!ComparatorUtils.findAtLeastOneMatchingIdentifier(feature1.getIdentifiers(), feature2.getIdentifiers())){ return false;
Collection<Xref> identifiers1 = feature1.getIdentifiers(); Collection<Xref> identifiers2 = feature2.getIdentifiers();
List<Xref> identifiers = new ArrayList<Xref>(feature.getIdentifiers());
/** * For each cross reference of this XrefContainer, collects all respective cross reference type(s) and * check if the dependencies are correct. * * @param container to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( Feature container) throws ValidatorException { Collection<ValidatorMessage> messages = new ArrayList<ValidatorMessage>(); // Collect the identifiers Collection<Xref> identifiers = container.getIdentifiers(); for ( Xref reference : identifiers) { MiContext context = RuleUtils.buildContext(reference, "database xref"); context.addAssociatedContext(RuleUtils.buildContext(container, "feature")); // build a context in case of error messages.addAll( mapping.check( reference.getDatabase(), reference.getQualifier(), context, this ) ); } // Collect the db references Collection<Xref> databaseReferences = container.getXrefs(); for ( Xref reference : databaseReferences) { MiContext context = RuleUtils.buildContext(reference, "database xref"); context.addAssociatedContext(RuleUtils.buildContext(container, "feature")); // build a context in case of error messages.addAll( mapping.check( reference.getDatabase(), reference.getQualifier(), context, this ) ); } return messages; }