Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Oct 14, 2024
1 parent 34d6c62 commit 0a7ff20
Showing 1 changed file with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ private BaseSchemaProvider(
final SpecMilestone untilMilestone,
final boolean isConstant) {
this.schemaId = schemaId;
// validateCreators(schemaProviderCreators);
final List<SchemaProviderCreator<T>> creatorsList = new ArrayList<>(schemaProviderCreators);

SchemaProviderCreator<T> lastCreator = null;
Expand All @@ -53,35 +52,6 @@ private BaseSchemaProvider(
}
}

// private void validateCreators(final List<SchemaProviderCreator<T>> schemaProviderCreators) {
// checkArgument(
// !schemaProviderCreators.isEmpty(), "There should be at least 1 creator for %s",
// schemaId);
// for (int i = 0; i < schemaProviderCreators.size(); i++) {
// final SchemaProviderCreator<T> currentCreator = schemaProviderCreators.get(i);
// if (i > 0) {
// checkArgument(
// currentCreator.milestone.isGreaterThan(schemaProviderCreators.get(i - 1).milestone),
// "Creator's milestones must be in order for %s",
// schemaId);
// }
// final boolean isLast = i == schemaProviderCreators.size() - 1;
// if (isLast) {
// checkArgument(
// currentCreator.untilMilestone.isEmpty()
// ||
// currentCreator.untilMilestone.get().isGreaterThanOrEqualTo(currentCreator.milestone),
// "Last creator untilMilestone must be greater or equal than milestone in %s",
// schemaId);
// } else {
// checkArgument(
// currentCreator.untilMilestone.isEmpty(),
// "Only last creator is allowed to use until for %s",
// schemaId);
// }
// }
// }

@Override
public SpecMilestone getEffectiveMilestone(final SpecMilestone milestone) {
return getSchemaCreator(milestone).milestone;
Expand All @@ -98,19 +68,6 @@ public SchemaId<T> getSchemaId() {
return schemaId;
}

// static <T> SchemaProviderCreator<T> schemaCreator(
// final SpecMilestone milestone,
// final BiFunction<SchemaRegistry, SpecConfig, T> creationSchema) {
// return new SchemaProviderCreator<>(milestone, Optional.empty(), creationSchema);
// }
//
// static <T> SchemaProviderCreator<T> schemaCreator(
// final SpecMilestone milestone,
// final SpecMilestone untilMilestone,
// final BiFunction<SchemaRegistry, SpecConfig, T> creationSchema) {
// return new SchemaProviderCreator<>(milestone, Optional.of(untilMilestone), creationSchema);
// }

protected T createSchema(
final SchemaRegistry registry,
final SpecMilestone effectiveMilestone,
Expand Down

0 comments on commit 0a7ff20

Please sign in to comment.