From 024b2594d4783a5547c3f4bd9b35fb87ac50a25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Bal=C3=A1k?= Date: Fri, 3 May 2019 14:01:41 +0200 Subject: [PATCH] FEAT: Date time not null validator --- .../validator/DateTimeNotNullValidator.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt diff --git a/formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt b/formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt new file mode 100644 index 0000000..ab22225 --- /dev/null +++ b/formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt @@ -0,0 +1,12 @@ +package cz.qase.android.formbuilderlibrary.validator + +import cz.qase.android.formbuilderlibrary.ValidationException +import org.joda.time.DateTime + +class DateTimeNotNullValidator(private val errorMsg: String) : FormValidator { + override fun validate(value: DateTime?) { + if (value == null) { + throw ValidationException(errorMsg) + } + } +}