-
Notifications
You must be signed in to change notification settings - Fork 23
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 #15 from clojj/dev/spike
fix dependency directions and put parsers & opaque types together
- Loading branch information
Showing
7 changed files
with
43 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
## Opaque Types, constructed by parsers | ||
|
||
There should be no other way to construct a value of | ||
|
||
1) `com.sksamuel.tribune.examples.valueclass.ParsedBook` (in the case of using `value class`) | ||
|
||
2) `com.sksamuel.tribune.examples.dataclass.Book` (in the case of using `data class`) | ||
|
||
_outside_ of the gradle-module `tribune-examples-model`. | ||
|
||
Hence each of these example types has its constructor declared as `internal` | ||
and offers the user parser functions, which are able to construct valid instances. |
7 changes: 7 additions & 0 deletions
7
tribune-examples-model/src/jvmMain/kotlin/com/sksamuel/tribune/examples/BookInput.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,7 @@ | ||
package com.sksamuel.tribune.examples | ||
|
||
data class BookInput( | ||
val title: String?, | ||
val author: String?, | ||
val isbn: String?, | ||
) |
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
22 changes: 0 additions & 22 deletions
22
tribune-examples/src/jvmMain/kotlin/com/sksamuel/tribune/examples/book.kt
This file was deleted.
Oops, something went wrong.
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