Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Last active August 29, 2015 14:01
Show Gist options
  • Save dwelch2344/1407364bd2776f6bae0d to your computer and use it in GitHub Desktop.
Save dwelch2344/1407364bd2776f6bae0d to your computer and use it in GitHub Desktop.
@Configuration
public class SampleConfig<T> {
@Bean
public Service<T> service(){
return new Service<T>(repo());
}
@Bean
public Repository<T> repo(){
return new Repository<T>();
}
}
public class Foo{
public void someMethod(){
someSpringObject.addConfiguration( new SampleConfig<User>() );
someSpringObject.addConfiguration( new SampleConfig<Organization>() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment