use of org.graylog2.database.validators.ObjectIdValidator in project graylog2-server by Graylog2.
the class StreamRuleImpl method getValidations.
@Override
public Map<String, Validator> getValidations() {
final ImmutableMap.Builder<String, Validator> validators = ImmutableMap.builder();
validators.put(FIELD_TYPE, new IntegerValidator());
validators.put(FIELD_STREAM_ID, new ObjectIdValidator());
validators.put(FIELD_CONTENT_PACK, new OptionalStringValidator());
if (!EnumSet.of(StreamRuleType.ALWAYS_MATCH).contains(this.getType())) {
validators.put(FIELD_FIELD, new FilledStringValidator());
}
if (!EnumSet.of(StreamRuleType.PRESENCE, StreamRuleType.ALWAYS_MATCH).contains(this.getType())) {
validators.put(FIELD_VALUE, new FilledStringValidator());
}
return validators.build();
}
Aggregations