Skip to content

Commit

Permalink
fix: update provider object eval, T -> Structure
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <toddbaert@gmail.com>
  • Loading branch information
toddbaert committed Aug 28, 2022
1 parent 405e812 commit 3cf5a6f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dev/openfeature/javasdk/FeatureProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValu
ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, EvaluationContext ctx,
FlagEvaluationOptions options);

<T> ProviderEvaluation<T> getObjectEvaluation(String key, T defaultValue, EvaluationContext invocationContext,
FlagEvaluationOptions options);
ProviderEvaluation<Structure> getObjectEvaluation(String key, Structure defaultValue,
EvaluationContext invocationContext, FlagEvaluationOptions options);
}
4 changes: 2 additions & 2 deletions src/main/java/dev/openfeature/javasdk/NoOpProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public ProviderEvaluation<Double> getDoubleEvaluation(String key, Double default
}

@Override
public <T> ProviderEvaluation<T> getObjectEvaluation(String key, T defaultValue,
public ProviderEvaluation<Structure> getObjectEvaluation(String key, Structure defaultValue,
EvaluationContext invocationContext,
FlagEvaluationOptions options) {
return ProviderEvaluation.<T>builder()
return ProviderEvaluation.<Structure>builder()
.value(defaultValue)
.variant(PASSED_IN_DEFAULT)
.reason(Reason.DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private <T> ProviderEvaluation<?> createProviderEvaluation(
case DOUBLE:
return provider.getDoubleEvaluation(key, (Double) defaultValue, invocationContext, options);
case OBJECT:
return provider.getObjectEvaluation(key, defaultValue, invocationContext, options);
return provider.getObjectEvaluation(key, (Structure) defaultValue, invocationContext, options);
default:
throw new GeneralError("Unknown flag type");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ProviderEvaluation<Double> getDoubleEvaluation(String key, Double default
}

@Override
public <T> ProviderEvaluation<T> getObjectEvaluation(String key, T defaultValue, EvaluationContext invocationContext, FlagEvaluationOptions options) {
public ProviderEvaluation<Structure> getObjectEvaluation(String key, Structure defaultValue, EvaluationContext invocationContext, FlagEvaluationOptions options) {
throw new NotImplementedException("BORK");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public ProviderEvaluation<Double> getDoubleEvaluation(String key, Double default
}

@Override
public <T> ProviderEvaluation<T> getObjectEvaluation(String key, T defaultValue, EvaluationContext invocationContext, FlagEvaluationOptions options) {
public ProviderEvaluation<Structure> getObjectEvaluation(String key, Structure defaultValue, EvaluationContext invocationContext, FlagEvaluationOptions options) {
savedContext = invocationContext;
return ProviderEvaluation.<T>builder()
return ProviderEvaluation.<Structure>builder()
.value(null)
.build();
}
Expand Down

0 comments on commit 3cf5a6f

Please sign in to comment.