<commit_before>package psidev.psi.mi.jami.utils.clone;

import psidev.psi.mi.jami.model.Experiment;

/**
 * Utility class for cloning experiments
 *
 * @author <NAME> (<EMAIL>)
 * @version $Id$
 * @since <pre>13/02/13</pre>
 */

public class ExperimentCloner {

    /***
     * This method will copy properties of experiment source in experiment target and will override all the other properties of Target experiment.
     * This method will ignore interaction evidences
     * @param source
     * @param target
     */
    public static void copyAndOverrideParticipantEvidenceProperties(Experiment source, Experiment target){
        if (source != null && target != null){
            target.setHostOrganism(source.getHostOrganism());
            target.setInteractionDetectionMethod(source.getInteractionDetectionMethod());
            target.setPublication(source.getPublication());
            target.setShortLabel(source.getShortLabel());

            // copy collections
            target.getAnnotations().clear();
            target.getAnnotations().addAll(source.getAnnotations());
            target.getXrefs().clear();
            target.getXrefs().addAll(source.getXrefs());
        }
    }<commit_msg>ExperimentCloner : added a utility class to clone experiments<commit_after>package psidev.psi.mi.jami.utils.clone;

import psidev.psi.mi.jami.model.Experiment;

/**
 * Utility class for cloning experiments
 *
 * @author <NAME> (<EMAIL>)
 * @version $Id$
 * @since <pre>13/02/13</pre>
 */

public class ExperimentCloner {

    /***
     * This method will copy properties of experiment source in experiment target and will override all the other properties of Target experiment.
     * This method will ignore interaction evidences
     * @param source
     * @param target
     */
    public static void copyAndOverrideExperimentProperties(Experiment source, Experiment target){
        if (source != null && target != null){
            target.setHostOrganism(source.getHostOrganism());
            target.setInteractionDetectionMethod(source.getInteractionDetectionMethod());
            target.setPublication(source.getPublication());
            target.setShortLabel(source.getShortLabel());

            // copy collections
            target.getAnnotations().clear();
            target.getAnnotations().addAll(source.getAnnotations());
            target.getXrefs().clear();
            target.getXrefs().addAll(source.getXrefs());
        }
    }
{'fraction_non_alphanumeric': 0.11057108140947752, 'fraction_numerical': 0.004860267314702308, 'mean_word_length': 3.0425531914893615, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1565194', 'n_tokens_mistral': 670, 'n_tokens_neox': 635, 'n_words': 151}