@Override protected Collection<ValidationResult> customValidate(ValidationContext validationContext) { final boolean isAvroSerializer = validationContext.getPropertyValue(RECORD_SERIALIZER).asString().toLowerCase().contains("avro"); final boolean isAvroSchemaSet = validationContext.getPropertyValue(RECORD_SCHEMA).isSet(); final List<ValidationResult> problems = new ArrayList<>(); if (isAvroSerializer && !isAvroSchemaSet) { problems.add(new ValidationResult.Builder() .subject(RECORD_SERIALIZER.getDisplayName()) .valid(false) .explanation("an avro schema must be provided with an avro serializer") .build()); } return problems; }
xmlStreamWriter.writeAttribute("id", "name"); if (property.isRequired()) { writeSimpleElement(xmlStreamWriter, "strong", property.getDisplayName()); } else { xmlStreamWriter.writeCharacters(property.getDisplayName());
.subject(RedisUtils.CONNECTION_STRING.getDisplayName()) .valid(false) .explanation("Connection String cannot be blank") if (hostAndPort == null || hostAndPort.length != 2 || StringUtils.isBlank(hostAndPort[0]) || StringUtils.isBlank(hostAndPort[1]) || !isInteger(hostAndPort[1])) { results.add(new ValidationResult.Builder() .subject(RedisUtils.CONNECTION_STRING.getDisplayName()) .input(connectionString) .valid(false) if (hostAndPort == null || hostAndPort.length != 2 || StringUtils.isBlank(hostAndPort[0]) || StringUtils.isBlank(hostAndPort[1]) || !isInteger(hostAndPort[1])) { results.add(new ValidationResult.Builder() .subject(RedisUtils.CONNECTION_STRING.getDisplayName()) .input(connection) .valid(false) .subject(RedisUtils.DATABASE.getDisplayName()) .valid(false) .explanation("Database Index must be 0 when using clustered Redis") if (StringUtils.isEmpty(sentinelMaster)) { results.add(new ValidationResult.Builder() .subject(RedisUtils.SENTINEL_MASTER.getDisplayName()) .valid(false) .explanation("Sentinel Master must be provided when Mode is Sentinel")
rstWriter.printStrong(property.getDisplayName()); } else { rstWriter.print(property.getDisplayName());