Recipe.java
1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Decompiled with CFR 0_118.
*/
package com.day.cq.analytics.testandtarget;
import com.day.cq.analytics.testandtarget.Conversion;
import com.day.cq.analytics.testandtarget.Step;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class Recipe {
public static final String TRAFFIC_TYPE_TESTING = "TESTING";
public static final String TRAFFIC_TYPE_TOTAL = "TOTAL";
private final String id;
private final String name;
private final String trafficType;
private final Conversion conversion;
private final List<Step> steps = new ArrayList<Step>();
public Recipe(String id, String name, String trafficType, Conversion conversion) {
this.id = id;
this.name = name;
this.trafficType = trafficType;
this.conversion = conversion;
}
public void addStep(Step step) {
this.steps.add(step);
}
public String getId() {
return this.id;
}
public String getName() {
return this.name;
}
public String getTrafficType() {
return this.trafficType;
}
public Conversion getConversion() {
return this.conversion;
}
public List<Step> getSteps() {
return this.steps;
}
public int getStepValueByName(String stepName) {
for (Step step : this.steps) {
if (!stepName.equals(step.getName())) continue;
return step.getCount().intValue();
}
return 0;
}
public int getConversionCount() {
return this.conversion != null ? this.conversion.getCount().intValue() : 0;
}
}