2 * Copyright (C) 2019 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.vaadin
.data
.validator
;
11 import com
.vaadin
.data
.Validator
;
13 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
16 * @author a.kohlbecker
20 public class TimePeriodCompletenesValidator
implements Validator
{
22 private static final long serialVersionUID
= 4651375734846907644L;
24 PartialCompletenesValidator partialValidator
= new PartialCompletenesValidator();
27 public void validate(Object value
) throws InvalidValueException
{
29 TimePeriod timePeriod
= (TimePeriod
)value
;
30 if(timePeriod
.getStart() != null){
31 partialValidator
.validate(timePeriod
.getEndDay());
33 if(timePeriod
.getEnd() != null){
34 partialValidator
.validate(timePeriod
.getEnd());