This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Quee-io/2-add-usecase-request-and-response…
…-adapter add usecase request and response adapter
- Loading branch information
Showing
27 changed files
with
114 additions
and
24 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
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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
ktx-radix-development/ktx-radix-development-usecase-adapter/pom.xml
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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>ktx-radix-development</artifactId> | ||
<groupId>io.quee.ktx.radix</groupId> | ||
<version>v1.0.2-RELEASE</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>ktx-radix-development-usecase-adapter</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>${project.parent.groupId}</groupId> | ||
<artifactId>ktx-radix-development-usecase</artifactId> | ||
<version>${project.parent.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
12 changes: 12 additions & 0 deletions
12
...usecase-adapter/src/main/java/io/quee/ktx/radix/develop/usecase/adapter/RequestAdapter.kt
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,12 @@ | ||
package io.quee.ktx.radix.develop.usecase.adapter | ||
|
||
import io.quee.ktx.radix.develop.usecase.model.UseCaseRequest | ||
|
||
/** | ||
* Created By [*Ibrahim AlTamimi *](https://www.linkedin.com/in/iloom/) | ||
* Created At 07, **Sat Nov, 2020** | ||
* Project **ktx-radix** [Quee.IO](https://quee.io) | ||
*/ | ||
data class RequestAdapter<R>( | ||
val request: R | ||
) : UseCaseRequest |
12 changes: 12 additions & 0 deletions
12
...secase-adapter/src/main/java/io/quee/ktx/radix/develop/usecase/adapter/ResponseAdapter.kt
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,12 @@ | ||
package io.quee.ktx.radix.develop.usecase.adapter | ||
|
||
import io.quee.ktx.radix.develop.usecase.model.UseCaseResponse | ||
|
||
/** | ||
* Created By [*Ibrahim AlTamimi *](https://www.linkedin.com/in/iloom/) | ||
* Created At 07, **Sat Nov, 2020** | ||
* Project **ktx-radix** [Quee.IO](https://quee.io) | ||
*/ | ||
data class ResponseAdapter<R>( | ||
val response: R | ||
) : UseCaseResponse |
44 changes: 44 additions & 0 deletions
44
...se-adapter/src/main/java/io/quee/ktx/radix/develop/usecase/adapter/usecase-adapter.ext.kt
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,44 @@ | ||
package io.quee.ktx.radix.develop.usecase.adapter | ||
|
||
import io.quee.ktx.radix.develop.usecase.* | ||
import io.quee.ktx.radix.develop.usecase.factory.UseCaseFactory | ||
import io.quee.ktx.radix.develop.usecase.model.UseCaseRequest | ||
import io.quee.ktx.radix.develop.usecase.model.UseCaseResponse | ||
|
||
/** | ||
* Created By [*Ibrahim AlTamimi *](https://www.linkedin.com/in/iloom/) | ||
* Created At 07, **Sat Nov, 2020** | ||
* Project **ktx-radix** [Quee.IO](https://quee.io) | ||
*/ | ||
infix fun <RQ, RS> FunctionalUseCase<RequestAdapter<RQ>, ResponseAdapter<RS>>.adapterProcess(request: RQ) = | ||
(this process RequestAdapter(request)).response | ||
|
||
infix fun <RQ, RS : UseCaseResponse> FunctionalUseCase<RequestAdapter<RQ>, RS>.adapterProcess(request: RQ) = | ||
this process RequestAdapter(request) | ||
|
||
infix fun <RQ : UseCaseRequest, RS> FunctionalUseCase<RQ, ResponseAdapter<RS>>.adapterProcess(request: RQ) = | ||
(this process request).response | ||
|
||
infix fun <RQ, RS> FunctionalUseCase<RequestAdapter<RQ>, ResponseAdapter<RS>>.adapterProcess(requestProvider: () -> RQ) = | ||
this adapterProcess requestProvider() | ||
|
||
infix fun <RQ, RS : UseCaseResponse> FunctionalUseCase<RequestAdapter<RQ>, RS>.adapterProcess(request: () -> RQ) = | ||
this adapterProcess request() | ||
|
||
infix fun <RQ> CommandUseCase<RequestAdapter<RQ>>.adapterExecute(request: RQ) = | ||
this execute RequestAdapter(request) | ||
|
||
infix fun <RQ> CommandUseCase<RequestAdapter<RQ>>.adapterExecute(requestProvider: () -> RQ) = | ||
this adapterExecute requestProvider() | ||
|
||
infix fun <F : UseCaseFactory, RQ, RS> F.adapterFunctional(functionalUseCase: F.() -> FunctionalUseCase<RequestAdapter<RQ>, ResponseAdapter<RS>>) = | ||
this functional functionalUseCase | ||
|
||
infix fun <F : UseCaseFactory, RQ : UseCaseRequest, RS> F.adapterFunctionalReq(functionalUseCase: F.() -> FunctionalUseCase<RQ, ResponseAdapter<RS>>) = | ||
this functional functionalUseCase | ||
|
||
infix fun <F : UseCaseFactory, RQ, RS : UseCaseResponse> F.adapterFunctionalResp(functionalUseCase: F.() -> FunctionalUseCase<RequestAdapter<RQ>, RS>) = | ||
this functional functionalUseCase | ||
|
||
infix fun <F : UseCaseFactory, RQ> F.adapterCommand(commandUseCase: F.() -> CommandUseCase<RequestAdapter<RQ>>) = | ||
this command commandUseCase |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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