Skip to content

Commit

Permalink
Issue #9: Further simplified the strongly-typed API.
Browse files Browse the repository at this point in the history
The Repository's type is not used from any of the TypedSchemaRepository's APIs, so it is not necessary to make it part of the generic type definition.
  • Loading branch information
FelixGV committed Jan 13, 2015
1 parent 8d1df60 commit 3bcc5d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
* N.B.2: registerIfLatest() is not supported in the TypedSchemaRepository,
* at least for now...
*/
public class TypedSchemaRepository<REPO extends Repository, ID, SCHEMA, SUBJECT> {
public class TypedSchemaRepository<ID, SCHEMA, SUBJECT> {

private REPO repo;
private Repository repo;
private Converter<ID> convertId;
private Converter<SCHEMA> convertSchema;
private Converter<SUBJECT> convertSubject;
Expand All @@ -58,7 +58,7 @@ public class TypedSchemaRepository<REPO extends Repository, ID, SCHEMA, SUBJECT>
// Constructors

public TypedSchemaRepository(
REPO repo,
Repository repo,
Converter<ID> idConverter,
Converter<SCHEMA> schemaConverter,
Converter<SUBJECT> subjectConverter,
Expand All @@ -72,7 +72,7 @@ public TypedSchemaRepository(
}

public TypedSchemaRepository(
REPO repo,
Repository repo,
Converter<ID> idConverter,
Converter<SCHEMA> schemaConverter,
Converter<SUBJECT> subjectConverter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public Repository createRepository() {
}
}

private <INNER_REPO extends Repository, ID, SCHEMA, SUBJECT> void testRegistration(
INNER_REPO innerRepo,
private <ID, SCHEMA, SUBJECT> void testRegistration(
Repository innerRepo,
Converter<ID> convertId,
Converter<SCHEMA> convertSchema,
Converter<SUBJECT> convertSubject) {
Expand All @@ -114,8 +114,8 @@ private <INNER_REPO extends Repository, ID, SCHEMA, SUBJECT> void testRegistrati
convertSubject.getClass().getSimpleName() + "): ";

try {
TypedSchemaRepository<INNER_REPO, ID, SCHEMA, SUBJECT> repo =
new TypedSchemaRepository<INNER_REPO, ID, SCHEMA, SUBJECT>
TypedSchemaRepository<ID, SCHEMA, SUBJECT> repo =
new TypedSchemaRepository<ID, SCHEMA, SUBJECT>
(innerRepo, convertId, convertSchema, convertSubject);

SUBJECT subject1 = convertSubject.fromString("sub1");
Expand Down

0 comments on commit 3bcc5d3

Please sign in to comment.