Removed generic examples
This commit is contained in:
parent
5f23e39332
commit
11bce96dc8
@ -1,38 +0,0 @@
|
|||||||
package org.baeldung.sampleabstract;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
public abstract class AbstractGenericService<T, S> {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private T genericFieldT;
|
|
||||||
|
|
||||||
private S genericFieldS;
|
|
||||||
|
|
||||||
public T getGenericFieldT() {
|
|
||||||
|
|
||||||
return genericFieldT;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenericFieldT(T genericFieldT) {
|
|
||||||
|
|
||||||
this.genericFieldT = genericFieldT;
|
|
||||||
}
|
|
||||||
|
|
||||||
public S getGenericFieldS() {
|
|
||||||
|
|
||||||
return genericFieldS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public void setGenericFieldS(S genericFieldS) {
|
|
||||||
|
|
||||||
this.genericFieldS = genericFieldS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void afterInitialize() {
|
|
||||||
|
|
||||||
System.out.println(genericFieldT.getClass().getSimpleName());
|
|
||||||
System.out.println(genericFieldS.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
}
|
|
@ -15,9 +15,6 @@ public class DemoApp {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FooService fooService;
|
private FooService fooService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private FooGenericService fooGenericService;
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(DemoApp.class);
|
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(DemoApp.class);
|
||||||
@ -27,6 +24,5 @@ public class DemoApp {
|
|||||||
public void afterInitialize() {
|
public void afterInitialize() {
|
||||||
|
|
||||||
fooService.afterInitialize();
|
fooService.afterInitialize();
|
||||||
fooGenericService.afterInitialize();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
package org.baeldung.sampleabstract;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class FooGenericService extends AbstractGenericService<FooBean, BarBean> {
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user