-
Notifications
You must be signed in to change notification settings - Fork 28
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 #99 from rchodava/rc/structured-values
Wiring improvements, wiring auto-construction, wiring modules, and serialization
- Loading branch information
Showing
39 changed files
with
1,065 additions
and
311 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
core/src/main/java/foundation/stack/datamill/configuration/Module.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,10 @@ | ||
package foundation.stack.datamill.configuration; | ||
|
||
import rx.functions.Action1; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
@FunctionalInterface | ||
public interface Module extends Action1<Wiring> { | ||
} |
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
362 changes: 277 additions & 85 deletions
362
core/src/main/java/foundation/stack/datamill/configuration/Wiring.java
Large diffs are not rendered by default.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.reflection.Member; | ||
import foundation.stack.datamill.serialization.StructuredInput; | ||
import foundation.stack.datamill.values.Value; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface Row { | ||
public interface Row extends StructuredInput { | ||
int size(); | ||
Value column(int index); | ||
Value column(String name); | ||
Value column(String table, String name); | ||
Value column(Member member); | ||
Value get(int index); | ||
Value get(String name); | ||
Value get(String table, String name); | ||
Value get(Member member); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
core/src/main/java/foundation/stack/datamill/json/Json.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 |
---|---|---|
@@ -1,7 +1,23 @@ | ||
package foundation.stack.datamill.json; | ||
|
||
import foundation.stack.datamill.serialization.DeserializationStrategy; | ||
import foundation.stack.datamill.serialization.Deserializer; | ||
import foundation.stack.datamill.serialization.SerializationStrategy; | ||
import foundation.stack.datamill.serialization.Serializer; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface Json { | ||
static <T> Deserializer<JsonObject, T> deserializer(DeserializationStrategy<T> strategy) { | ||
return json -> strategy.deserialize(json); | ||
} | ||
|
||
static <T> Serializer<T, JsonObject> serializer(SerializationStrategy<T> strategy) { | ||
return o -> { | ||
JsonObject json = new JsonObject(); | ||
strategy.serialize(json, o); | ||
return json; | ||
}; | ||
} | ||
} |
Oops, something went wrong.