/** * Checks if an experiment or the experiments for the same publication are on hold. * If the Experiment object contains a Publication, all the experiments from the publication * are checked. If any of them is on hold, the method will return true. * * @param experiment The experiment to check * @return true if the experiment is on hold, or any of the experiments for the same publication object */ public static boolean isOnHold(Experiment experiment) { if (experiment.getPublication() != null) { return isPublicationOnHold(experiment.getPublication()); } for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.ON_HOLD.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; }
/** * Checks if an experiment or the experiments for the same publication are on hold. * If the Experiment object contains a Publication, all the experiments from the publication * are checked. If any of them is on hold, the method will return true. * * @param experiment The experiment to check * @return true if the experiment is on hold, or any of the experiments for the same publication object */ public static boolean isOnHold(Experiment experiment) { if (experiment.getPublication() != null) { return isPublicationOnHold(experiment.getPublication()); } for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.ON_HOLD.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; }