mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-12 02:25:59 +01:00
Add basic date filter
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package at.pcgamingfreaks.mkvaudiosubtitlechanger.config.validator;
|
||||
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.model.ConfigProperty;
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.util.DateUtils;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DateValidator extends ConfigValidator<Date> {
|
||||
public DateValidator(ConfigProperty property, boolean required) {
|
||||
super(property, required, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
Date parse(String value) {
|
||||
return DateUtils.convert(value); // TODO fix null return value
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isValid(Date result) {
|
||||
return result != null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user