Skip to content

Commit 076a850

Browse files
committed
Convert fallback config to String
1 parent 480d1f3 commit 076a850

File tree

4 files changed

+42
-45
lines changed

4 files changed

+42
-45
lines changed

client/src/main/java/io/split/client/SplitClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ private SplitResult checkFallbackTreatment(String featureName) {
548548
FallbackTreatment fallbackTreatment = _fallbackTreatmentCalculator.resolve(featureName, "");
549549
String config = null;
550550
if (fallbackTreatment.getConfig() != null) {
551-
config = fallbackTreatment.getConfig().toString();
551+
config = fallbackTreatment.getConfig();
552552
}
553553
return new SplitResult(fallbackTreatment.getTreatment(), config);
554554
}

client/src/main/java/io/split/client/dtos/FallbackTreatment.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package io.split.client.dtos;
22

3-
import java.util.Map;
4-
53
public class FallbackTreatment {
6-
private final Map<String, Object> _config;
4+
private final String _config;
75
private final String _treatment;
86
private final String _label;
97

10-
public FallbackTreatment(String treatment, Map<String, Object> config) {
8+
public FallbackTreatment(String treatment, String config) {
119
_treatment = treatment;
1210
_config = config;
1311
_label = null;
@@ -19,13 +17,13 @@ public FallbackTreatment(String treatment) {
1917
_label = null;
2018
}
2119

22-
public FallbackTreatment(String treatment, Map<String, Object> config, String label) {
20+
public FallbackTreatment(String treatment, String config, String label) {
2321
_treatment = treatment;
2422
_config = config;
2523
_label = label;
2624
}
2725

28-
public Map<String, Object> getConfig() {
26+
public String getConfig() {
2927
return _config;
3028
}
3129

client/src/main/java/io/split/engine/evaluator/EvaluatorImp.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private String getConfig(ParsedSplit parsedSplit, String returnedTreatment) {
197197

198198
private String getFallbackConfig(FallbackTreatment fallbackTreatment) {
199199
if (fallbackTreatment.getConfig() != null) {
200-
return fallbackTreatment.getConfig().toString();
200+
return fallbackTreatment.getConfig();
201201
}
202202

203203
return null;
@@ -206,7 +206,6 @@ private String getFallbackConfig(FallbackTreatment fallbackTreatment) {
206206
private TreatmentLabelAndChangeNumber evaluateParsedSplit(String matchingKey, String bucketingKey, Map<String, Object> attributes,
207207
ParsedSplit parsedSplit, String featureName) {
208208
try {
209-
210209
if (parsedSplit == null) {
211210
FallbackTreatment fallbackTreatment = _fallbackTreatmentCalculator.resolve(featureName, Labels.DEFINITION_NOT_FOUND);
212211
return new TreatmentLabelAndChangeNumber(fallbackTreatment.getTreatment(),

0 commit comments

Comments
 (0)