• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

optimizely / java-sdk / 2001

pending completion
2001

push

travis-ci-com

jaeopt
patches cherry-picked

4889 of 5384 relevant lines covered (90.81%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.15
/core-api/src/main/java/com/optimizely/ab/config/FeatureVariableUsageInstance.java
1
/**
2
 *
3
 *    Copyright 2016-2017, 2019, Optimizely and contributors
4
 *
5
 *    Licensed under the Apache License, Version 2.0 (the "License");
6
 *    you may not use this file except in compliance with the License.
7
 *    You may obtain a copy of the License at
8
 *
9
 *        http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 *    Unless required by applicable law or agreed to in writing, software
12
 *    distributed under the License is distributed on an "AS IS" BASIS,
13
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 *    See the License for the specific language governing permissions and
15
 *    limitations under the License.
16
 */
17
package com.optimizely.ab.config;
18

19
import com.fasterxml.jackson.annotation.JsonCreator;
20
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21
import com.fasterxml.jackson.annotation.JsonProperty;
22

23
/**
24
 * Represents the value of a feature variable for a variation
25
 */
26
@JsonIgnoreProperties(ignoreUnknown = true)
27
public class FeatureVariableUsageInstance implements IdMapped {
28

29
    private final String id;
30
    private final String value;
31

32
    @JsonCreator
33
    public FeatureVariableUsageInstance(@JsonProperty("id") String id,
34
                                        @JsonProperty("value") String value) {
1✔
35
        this.id = id;
1✔
36
        this.value = value;
1✔
37
    }
1✔
38

39
    public String getId() {
40
        return id;
1✔
41
    }
42

43
    public String getValue() {
44
        return value;
1✔
45
    }
46

47
    @Override
48
    public boolean equals(Object o) {
49
        if (this == o) return true;
×
50
        if (o == null || getClass() != o.getClass()) return false;
×
51

52
        FeatureVariableUsageInstance that = (FeatureVariableUsageInstance) o;
×
53

54
        return id.equals(that.id) && value.equals(that.value);
×
55
    }
56

57
    @Override
58
    public int hashCode() {
59
        int result = id.hashCode();
×
60
        result = 31 * result + value.hashCode();
×
61
        return result;
×
62
    }
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc