Skip to content

Commit 095b467

Browse files
author
Varun Rathore
committed
fix build
1 parent cc35f45 commit 095b467

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

src/main/java/com/google/firebase/remoteconfig/ParameterValue.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.google.firebase.remoteconfig.internal.TemplateResponse.PersonalizationValueResponse;
2828
import com.google.firebase.remoteconfig.internal.TemplateResponse.RolloutValueResponse;
2929

30-
import java.util.ArrayList;
3130
import java.util.List;
3231
import java.util.Objects;
3332

@@ -82,12 +81,10 @@ public static PersonalizationValue ofPersonalization(String personalizationId) {
8281
*
8382
* @param experimentId The experiment ID.
8483
* @param variantValues The list of experiment variant values.
85-
* @param exposurePercent The percentage of users exposed to the experiment.
8684
* @return A {@link ParameterValue.ExperimentValue} instance.
8785
*/
88-
public static ExperimentValue ofExperiment(
89-
String experimentId,
90-
List<ExperimentVariantValue> variantValues, Double exposurePercent) {
86+
public static ExperimentValue ofExperiment(String experimentId,
87+
List<ExperimentVariantValue> variantValues, double exposurePercent) {
9188
return new ExperimentValue(experimentId, variantValues, exposurePercent);
9289
}
9390

@@ -121,8 +118,7 @@ static ParameterValue fromParameterValueResponse(
121118
.map(evv -> new ExperimentVariantValue(
122119
evv.getVariantId(), evv.getValue(), evv.getNoChange()))
123120
.collect(toList());
124-
return ParameterValue.ofExperiment(
125-
ev.getExperimentId(), variantValues, ev.getExposurePercent());
121+
return ParameterValue.ofExperiment(ev.getExperimentId(), variantValues, ev.getExposurePercent());
126122
}
127123
return ParameterValue.of(parameterValueResponse.getValue());
128124
}
@@ -403,10 +399,10 @@ public int hashCode() {
403399
public static final class ExperimentValue extends ParameterValue {
404400
private final String experimentId;
405401
private final List<ExperimentVariantValue> variantValues;
406-
private final Double exposurePercent;
402+
private final double exposurePercent;
407403

408404

409-
private ExperimentValue(String experimentId, List<ExperimentVariantValue> variantValues, Double exposurePercent) {
405+
private ExperimentValue(String experimentId, List<ExperimentVariantValue> variantValues, double exposurePercent) {
410406
this.experimentId = experimentId;
411407
this.variantValues = variantValues;
412408
this.exposurePercent = exposurePercent;
@@ -421,13 +417,14 @@ public String getExperimentId() {
421417
return experimentId;
422418
}
423419

424-
425420
/**
426-
* Gets the percentage of users exposed to the experiment.
421+
* Gets the exposure percentage of the experiment linked to this value.
427422
*
428-
* @return The exposure percent
423+
* @return Exposure percentage of the experiment linked to this value.
429424
*/
430-
public Double getExposurePercent() { return exposurePercent; }
425+
public double getExposurePercent() {
426+
return exposurePercent;
427+
}
431428

432429

433430
/**
@@ -464,7 +461,7 @@ public boolean equals(Object o) {
464461
ExperimentValue that = (ExperimentValue) o;
465462
return Objects.equals(experimentId, that.experimentId)
466463
&& Objects.equals(variantValues, that.variantValues)
467-
&& Objects.equals(exposurePercent, that.exposurePercent);
464+
&& Double.compare(that.exposurePercent, exposurePercent) == 0;
468465
}
469466

470467
@Override

src/test/java/com/google/firebase/remoteconfig/ParameterValueTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static org.junit.Assert.assertEquals;
2020
import static org.junit.Assert.assertNotEquals;
21-
import static org.junit.Assert.assertTrue;
2221

2322
import com.google.common.collect.ImmutableList;
2423
import com.google.firebase.remoteconfig.ParameterValue.ExperimentVariantValue;

0 commit comments

Comments
 (0)