/** * Retrieves the experiment from a publication, initializing them if necessary. * * @param publication the publication * @return The returned experiments are ensured to be initialized * @since 2.4.0 */ public static Collection<Experiment> ensureInitializedExperiments(Publication publication) { Collection<Experiment> experiments; if (IntactCore.isInitialized(publication.getExperiments())) { experiments = publication.getExperiments(); } else { experiments = IntactContext.getCurrentInstance().getDaoFactory().getExperimentDao().getByPubAc(publication.getAc()); } return experiments; }
/** * Retrieves the experiment from a publication, initializing them if necessary. * * @param publication the publication * @return The returned experiments are ensured to be initialized * @since 2.4.0 */ public static Collection<Experiment> ensureInitializedExperiments(Publication publication) { Collection<Experiment> experiments; if (IntactCore.isInitialized(publication.getExperiments())) { experiments = publication.getExperiments(); } else { experiments = IntactContext.getCurrentInstance().getDaoFactory().getExperimentDao().getByPubAc(publication.getAc()); } return experiments; }