• 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

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

18
import com.optimizely.ab.config.IdKeyMapped;
19
import com.optimizely.ab.config.audience.Condition;
20

21
import java.util.List;
22

23
/**
24
 * Represents the Audiences list {@link OptimizelyConfig}
25
 */
26
public class OptimizelyAudience{
27

28
    private String id;
29
    private String name;
30
    private String conditions;
31

32
    public OptimizelyAudience(String id,
33
                              String name,
34
                              String conditions) {
1✔
35
        this.id = id;
1✔
36
        this.name = name;
1✔
37
        this.conditions = conditions;
1✔
38
    }
1✔
39

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

42
    public String getName() { return name; }
1✔
43

44
    public String getConditions() { return conditions; }
×
45

46
    @Override
47
    public boolean equals(Object obj) {
48
        if (obj == null || getClass() != obj.getClass()) return false;
×
49
        if (obj == this) return true;
×
50
        OptimizelyAudience optimizelyAudience = (OptimizelyAudience) obj;
×
51
        return id.equals(optimizelyAudience.getId()) &&
×
52
            name.equals(optimizelyAudience.getName()) &&
×
53
            conditions.equals(optimizelyAudience.getConditions());
×
54
    }
55

56
    @Override
57
    public int hashCode() {
58
        int hash = id.hashCode();
×
59
        hash = 31 * hash + conditions.hashCode();
×
60
        return hash;
×
61
    }
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