@Test public void basicValidateWhenDisabled() throws ConfigException { assertTrue(savedSearchConfigValidator.validate(new SavedSearchConfig.Builder() .setPollForUpdates(false) .setPollingInterval(-1) .build() ).isValid()); }
@Override public ValidationResult<Void> validate(final SavedSearchConfig config) { boolean valid = true; if(config.getPollForUpdates() != null && config.getPollForUpdates() && (config.getPollingInterval() == null || config.getPollingInterval() < 0)) { valid = false; } return new ValidationResult<>(valid); }
SavedSearchConfigValidator implements Validator<SavedSearchConfig> { @Override public ValidationResult<Void> validate(final SavedSearchConfig config) { boolean valid = true; if(config.getPollForUpdates() != null && config.getPollForUpdates() && (config.getPollingInterval() == null || config.getPollingInterval() < 0)) { valid = false; } return new ValidationResult<>(valid); } }
SavedSearchConfigValidator implements Validator<SavedSearchConfig> { @Override public ValidationResult<Void> validate(final SavedSearchConfig config) { boolean valid = true; if(config.getPollForUpdates() != null && config.getPollForUpdates() && (config.getPollingInterval() == null || config.getPollingInterval() < 0)) { valid = false; } return new ValidationResult<>(valid); }  }
SavedSearchConfigValidator implements Validator<SavedSearchConfig> { @Override public ValidationResult<Void> validate(final SavedSearchConfig config) { boolean valid = true; if(config.getPollForUpdates() != null && config.getPollForUpdates() && (config.getPollingInterval() == null || config.getPollingInterval() < 0)) { valid = false; } return new ValidationResult<>(valid); }  @Override ValidationResult<Void> validate(final SavedSearchConfig config); @Override Class<SavedSearchConfig> getSupportedClass(); }
SavedSearchConfigValidator implements Validator<SavedSearchConfig> { @Override public ValidationResult<Void> validate(final SavedSearchConfig config) { boolean valid = true; if(config.getPollForUpdates() != null && config.getPollForUpdates() && (config.getPollingInterval() == null || config.getPollingInterval() < 0)) { valid = false; } return new ValidationResult<>(valid); }  @Override ValidationResult<Void> validate(final SavedSearchConfig config); @Override Class<SavedSearchConfig> getSupportedClass();  }