How to make the same thing without Spring ? I don't know how to declare the bean using specific constructor.
Usually I would do it with Spring this way, but right now I can't use Spring.
@Configuration public class ClientConfig { @Bean public MyApi myApi() { return Feign.builder().target(MyApi.class, myUrl); } } And use injection in another class.
public class AnotherClass { @Inject MyApi myApi; } How to "declare" the bean? Today I'm using a singleton and it is 'ugly', so thanks in advance for any advice.