package com.homeadvisor.kafdrop.config;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

@Configuration
public class SchemaRegistryConfiguration {


    @Component
    @ConfigurationProperties(prefix = "schemaregistry")
    public static class SchemaRegistryProperties
    {
        public static final Pattern CONNECT_SEPARATOR = Pattern.compile("\\s*,\\s*");
        @NotBlank
        private String connect;

        public String getConnect()
        {
            return connect;
        }

        public void setConnect(String connect)
        {
            this.connect = connect;
        }

        public List<String> getConnectList()
        {
            return CONNECT_SEPARATOR.splitAsStream(this.connect)
                    .map(String::trim)
                    .filter(s -> s.length() > 0)
                    .collect(Collectors.toList());
        }

    }

}

@@ -278,99 +278,8 @@
 t;%0A%0A
-import java.util.List;%0Aimport java.util.regex.Pattern;%0Aimport java.util.stream.Collectors;%0A
 %0A@Co
@@ -465,94 +465,8 @@
   %7B%0A
-        public static final Pattern CONNECT_SEPARATOR = Pattern.compile(%22%5C%5Cs*,%5C%5Cs*%22);%0A
     
@@ -645,32 +645,32 @@
 nect)%0A        %7B%0A
+
             this
@@ -704,278 +704,8 @@
  %7D%0A%0A
-        public List%3CString%3E getConnectList()%0A        %7B%0A            return CONNECT_SEPARATOR.splitAsStream(this.connect)%0A                    .map(String::trim)%0A                    .filter(s -%3E s.length() %3E 0)%0A                    .collect(Collectors.toList());%0A        %7D%0A%0A
     

Remove list-parsing code from schema registry config parser