Mercurial > lada > lada-server
view src/main/java/de/intevation/lada/validation/rules/probe/HasTestdatensatz.java @ 711:3ec358698b4d
Code style and documentation.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 22 Jul 2015 16:03:03 +0200 |
parents | 3d38d1fe9e88 |
children | 1c41c7b8f7c2 |
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=3) * and comes with ABSOLUTELY NO WARRANTY! Check out * the documentation coming with IMIS-Labordaten-Application for details. */ package de.intevation.lada.validation.rules.probe; import de.intevation.lada.model.land.LProbe; import de.intevation.lada.validation.Violation; import de.intevation.lada.validation.annotation.ValidationRule; import de.intevation.lada.validation.rules.Rule; /** * Validation rule for probe. * Validates if the field "test" was set. * * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> */ @ValidationRule("Probe") public class HasTestdatensatz implements Rule { @Override public Violation execute(Object object) { LProbe probe = (LProbe)object; if (probe.getTest() == null || probe.getTest().equals("")) { Violation violation = new Violation(); violation.addError("test", 631); return violation; } return null; } }