forked from SORMAS-Foundation/SORMAS-Project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
sormas-ui/src/main/java/de/symeda/sormas/ui/utils/EbsAnimalDeathValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
package de.symeda.sormas.ui.utils; | ||
|
||
import com.vaadin.v7.data.validator.AbstractValidator; | ||
|
||
import de.symeda.sormas.api.utils.DataHelper; | ||
|
||
@SuppressWarnings("serial") | ||
public class EbsAnimalDeathValidator extends AbstractValidator<String> { | ||
|
||
public boolean isValidDeath; | ||
|
||
public EbsAnimalDeathValidator(String errorMessage, boolean isValidDeath) { | ||
super(errorMessage); | ||
this.isValidDeath = isValidDeath; | ||
} | ||
|
||
@Override | ||
protected boolean isValidValue(String death) { | ||
return DataHelper.isValidAnimalEbsDeath(isValidDeath); | ||
} | ||
|
||
public void setValidDeath(boolean validDeath) { | ||
this.isValidDeath = validDeath; | ||
} | ||
|
||
@Override | ||
public Class<String> getType() { | ||
return String.class; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
sormas-ui/src/main/java/de/symeda/sormas/ui/utils/EbsDateValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
package de.symeda.sormas.ui.utils; | ||
|
||
import com.vaadin.v7.data.validator.AbstractValidator; | ||
|
||
import de.symeda.sormas.api.utils.DataHelper; | ||
|
||
@SuppressWarnings("serial") | ||
public class EbsDateValidator extends AbstractValidator<String> { | ||
|
||
public boolean isValidDate; | ||
|
||
public EbsDateValidator(String errorMessage, boolean isValidDate) { | ||
super(errorMessage); | ||
this.isValidDate = isValidDate; | ||
} | ||
|
||
@Override | ||
protected boolean isValidValue(String Date) { | ||
return DataHelper.isValidEbsDate(isValidDate); | ||
} | ||
|
||
public void setValidDate(boolean isValidDate) { | ||
this.isValidDate = isValidDate; | ||
} | ||
|
||
@Override | ||
public Class<String> getType() { | ||
return String.class; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
sormas-ui/src/main/java/de/symeda/sormas/ui/utils/EbsPersonDeathValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
package de.symeda.sormas.ui.utils; | ||
|
||
import com.vaadin.v7.data.validator.AbstractValidator; | ||
|
||
import de.symeda.sormas.api.utils.DataHelper; | ||
|
||
@SuppressWarnings("serial") | ||
public class EbsPersonDeathValidator extends AbstractValidator<String> { | ||
|
||
public boolean isValidDeath; | ||
|
||
public EbsPersonDeathValidator(String errorMessage, boolean isValidDeath) { | ||
super(errorMessage); | ||
this.isValidDeath = isValidDeath; | ||
} | ||
|
||
@Override | ||
protected boolean isValidValue(String death) { | ||
return DataHelper.isValidPersonEbsDeath(isValidDeath); | ||
} | ||
|
||
public void setValidDeath(boolean validDeath) { | ||
this.isValidDeath = validDeath; | ||
} | ||
|
||
@Override | ||
public Class<String> getType() { | ||
return String.class; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
sormas-ui/src/main/java/de/symeda/sormas/ui/utils/EbsPhoneNumberValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/******************************************************************************* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
package de.symeda.sormas.ui.utils; | ||
|
||
import com.vaadin.v7.data.validator.AbstractValidator; | ||
|
||
import de.symeda.sormas.api.utils.DataHelper; | ||
|
||
@SuppressWarnings("serial") | ||
public class EbsPhoneNumberValidator extends AbstractValidator<String> { | ||
|
||
public EbsPhoneNumberValidator(String errorMessage) { | ||
super(errorMessage); | ||
} | ||
|
||
@Override | ||
protected boolean isValidValue(String phoneNumber) { | ||
return DataHelper.isValidEbsPhoneNumber(phoneNumber); | ||
} | ||
|
||
@Override | ||
public Class<String> getType() { | ||
return String.class; | ||
} | ||
} |