Remove hook evaluation. Not in the spec anymore
This commit is contained in:
parent
4d2de562f0
commit
1d82637d07
|
|
@ -8,16 +8,14 @@ import javax.annotation.Nullable;
|
|||
@Data @Builder
|
||||
public class FlagEvaluationDetails<T> implements BaseEvaluation<T> {
|
||||
String flagKey;
|
||||
HookEvaluation executedHooks;
|
||||
T value;
|
||||
@Nullable String variant;
|
||||
Reason reason;
|
||||
@Nullable ErrorCode errorCode;
|
||||
|
||||
public static <T> FlagEvaluationDetails<T> from(ProviderEvaluation<T> providerEval, String flagKey, HookEvaluation executedHooks) {
|
||||
public static <T> FlagEvaluationDetails<T> from(ProviderEvaluation<T> providerEval, String flagKey) {
|
||||
return FlagEvaluationDetails.<T>builder()
|
||||
.flagKey(flagKey)
|
||||
.executedHooks(executedHooks)
|
||||
.value(providerEval.getValue())
|
||||
.variant(providerEval.getVariant())
|
||||
.reason(providerEval.getReason())
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
package javasdk;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HookEvaluation<T> {
|
||||
private List<Hook<T>> before = new ArrayList<>();
|
||||
private List<Hook<T>> after = new ArrayList<>();
|
||||
private List<Hook<T>> error = new ArrayList<>();
|
||||
private List<Hook<T>> afterAll = new ArrayList<>();
|
||||
|
||||
public void addBefore(Hook<T> h) {
|
||||
before.add(h);
|
||||
}
|
||||
public void addAfter(Hook<T> h) {
|
||||
after.add(h);
|
||||
}
|
||||
public void addError(Hook<T> h) {
|
||||
error.add(h);
|
||||
}
|
||||
public void addAfterAll(Hook<T> h) {
|
||||
afterAll.add(h);
|
||||
}
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ public class OpenFeatureClient implements Client {
|
|||
throw new GeneralError("Unknown flag type");
|
||||
}
|
||||
|
||||
details = FlagEvaluationDetails.from(providerEval, key, null);
|
||||
details = FlagEvaluationDetails.from(providerEval, key);
|
||||
this.afterHooks(hookCtx, details, mergedHooks, hints);
|
||||
} catch (Exception e) {
|
||||
log.error("Unable to correctly evaluate flag with key {} due to exception {}", key, e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue