I have multiple similar configuration classes in my project.
@Configuration
public class configA {
private final static String CONFIG_STRING = "configA";
@Bean( name = "first" + CONFIG_STRING )
public First first() {
...
}
@Bean( name = "second" + CONFIG_STRING )
public Second second() {
...
}
}
@Configuration
public class configB {
private final static String CONFIG_STRING = "configB";
@Bean( name = "first" + CONFIG_STRING )
public First first() {
...
}
@Bean( name = "second" + CONFIG_STRING )
public Second second() {
...
}
}
They're all the same, only the CONFIG_STRING
is different.
Can I refactor those classes?