Commit 45d122b
committed
noop(codehealth) rename types to reflect axis of transformation
this entirely a change for code clarity, because if you read (before
this patch) the `AnyToAnyImporter#import` generic-params you'll see
`To` being passed in as the source of data (what should be a conceptual
"From").
The cause of that confusion is that there's multiple different
orthogonal transformations happening with/around the
`TransferCompatibilityProvider` and its supporting `AnyToAnyImporter`
class and DTP generally:
1. DTP moves data from a Exporter producing models to an Importer
consuming models
1. we have static functions that convert model A to model B (eg: from
Photos model to a Media model via
[`MediaContainerResource::photoToMedia`][pToMedia])
- this is parallel to the `From` and `To` generic params of
[`java.util.function.Function<From, To>`][Function].
1. `TransferCompatibilityProvider` converts *an importer* (via
`AnyToAnyImporter` and a model-transformer like above) from an
importer of one model type to an importer of another model type.
I'm now using the language of "stand-in importer" to indicate which
importer was selected as the input (think the `g` in `f(g(x)`) to
indicate the key moving piece in that last kind of transformation listed
above.
[Function]: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Function.html
[pToMedia]: https://github.com/dtinit/data-transfer-project/blob/bca0c7926fb871c7fdd7e206908a87874ec624f2/portability-types-common/src/main/java/org/datatransferproject/types/common/models/media/MediaContainerResource.java#L451 parent bca0c79 commit 45d122b
2 files changed
Lines changed: 55 additions & 23 deletions
File tree
- portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/provider
- converter
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 46 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
16 | 40 | | |
17 | 41 | | |
18 | 42 | | |
19 | | - | |
20 | | - | |
| 43 | + | |
| 44 | + | |
21 | 45 | | |
22 | | - | |
23 | | - | |
| 46 | + | |
| 47 | + | |
24 | 48 | | |
25 | 49 | | |
26 | | - | |
27 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
28 | 53 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
32 | 60 | | |
33 | 61 | | |
34 | 62 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
38 | 70 | | |
39 | 71 | | |
0 commit comments