From 11bce96dc8da2da189f8da0df99ffe8fbe28c37f Mon Sep 17 00:00:00 2001 From: Erhan KARAKAYA Date: Sun, 3 Feb 2019 22:47:10 +0300 Subject: [PATCH] Removed generic examples --- .../AbstractGenericService.java | 38 ------------------- .../org/baeldung/sampleabstract/DemoApp.java | 4 -- .../sampleabstract/FooGenericService.java | 8 ---- 3 files changed, 50 deletions(-) delete mode 100644 spring-all/src/main/java/org/baeldung/sampleabstract/AbstractGenericService.java delete mode 100644 spring-all/src/main/java/org/baeldung/sampleabstract/FooGenericService.java diff --git a/spring-all/src/main/java/org/baeldung/sampleabstract/AbstractGenericService.java b/spring-all/src/main/java/org/baeldung/sampleabstract/AbstractGenericService.java deleted file mode 100644 index 88451d5181..0000000000 --- a/spring-all/src/main/java/org/baeldung/sampleabstract/AbstractGenericService.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.baeldung.sampleabstract; - -import org.springframework.beans.factory.annotation.Autowired; - -public abstract class AbstractGenericService { - - @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()); - } -} diff --git a/spring-all/src/main/java/org/baeldung/sampleabstract/DemoApp.java b/spring-all/src/main/java/org/baeldung/sampleabstract/DemoApp.java index f6e7fd47b5..0c3c4ea083 100644 --- a/spring-all/src/main/java/org/baeldung/sampleabstract/DemoApp.java +++ b/spring-all/src/main/java/org/baeldung/sampleabstract/DemoApp.java @@ -15,9 +15,6 @@ public class DemoApp { @Autowired private FooService fooService; - @Autowired - private FooGenericService fooGenericService; - public static void main(String[] args) { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(DemoApp.class); @@ -27,6 +24,5 @@ public class DemoApp { public void afterInitialize() { fooService.afterInitialize(); - fooGenericService.afterInitialize(); } } diff --git a/spring-all/src/main/java/org/baeldung/sampleabstract/FooGenericService.java b/spring-all/src/main/java/org/baeldung/sampleabstract/FooGenericService.java deleted file mode 100644 index 45ad15e33a..0000000000 --- a/spring-all/src/main/java/org/baeldung/sampleabstract/FooGenericService.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.baeldung.sampleabstract; - -import org.springframework.stereotype.Component; - -@Component -public class FooGenericService extends AbstractGenericService { - -}