This repository has been archived by the owner on Jun 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing OS to work with abstract services
- Loading branch information
Showing
6 changed files
with
102 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
cdi/src/test/java/pl/softwaremill/cdiext/objectservice/AbstractService3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package pl.softwaremill.cdiext.objectservice; | ||
|
||
/** | ||
* @author Adam Warski (adam at warski dot org) | ||
*/ | ||
public abstract class AbstractService3<T extends A> implements Service3<T> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
cdi/src/test/java/pl/softwaremill/cdiext/objectservice/Service3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package pl.softwaremill.cdiext.objectservice; | ||
|
||
/** | ||
* A service for which implementations inherit from an abtract service. | ||
* @author Adam Warski (adam at warski dot org) | ||
*/ | ||
public interface Service3<T extends A> extends OS<T> { | ||
Object get(); | ||
} |
18 changes: 18 additions & 0 deletions
18
cdi/src/test/java/pl/softwaremill/cdiext/objectservice/Service3B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.softwaremill.cdiext.objectservice; | ||
|
||
/** | ||
* @author Adam Warski (adam at warski dot org) | ||
*/ | ||
public class Service3B extends AbstractService3<B> { | ||
private B serviced; | ||
|
||
@Override | ||
public void setServiced(B serviced) { | ||
this.serviced = serviced; | ||
} | ||
|
||
@Override | ||
public Object get() { | ||
return serviced.getValue(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
cdi/src/test/java/pl/softwaremill/cdiext/objectservice/Service3C.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.softwaremill.cdiext.objectservice; | ||
|
||
/** | ||
* @author Adam Warski (adam at warski dot org) | ||
*/ | ||
public class Service3C extends AbstractService3<C> { | ||
private C serviced; | ||
|
||
@Override | ||
public void setServiced(C serviced) { | ||
this.serviced = serviced; | ||
} | ||
|
||
@Override | ||
public Object get() { | ||
return serviced.getValue(); | ||
} | ||
} |