Skip to content

Commit 0fd9305

Browse files
committed
PR 1.2 — Extract: Create parsing-commons module
Move 18 DTOs from client/dtos, ParsedCondition + ParserUtils from engine/experiments, and Labels from engine/evaluator into a new parsing-commons module. Add targeting-engine as its only dependency. Add parsing-commons dep to client/pom.xml and register module in root pom.xml.
1 parent 62ce66a commit 0fd9305

24 files changed

+577
-0
lines changed

client/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@
172172
<artifactId>targeting-engine</artifactId>
173173
<version>${project.version}</version>
174174
</dependency>
175+
<dependency>
176+
<groupId>io.split.client</groupId>
177+
<artifactId>parsing-commons</artifactId>
178+
<version>${project.version}</version>
179+
</dependency>
175180
<dependency>
176181
<groupId>io.split.client</groupId>
177182
<artifactId>pluggable-storage</artifactId>

parsing-commons/pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>io.split.client</groupId>
7+
<artifactId>java-client-parent</artifactId>
8+
<version>4.18.3</version>
9+
</parent>
10+
11+
<version>4.18.3</version>
12+
<artifactId>parsing-commons</artifactId>
13+
<packaging>jar</packaging>
14+
<name>Parsing Commons</name>
15+
<description>DTOs and parsing utilities shared between Split SDK modules</description>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>io.split.client</groupId>
20+
<artifactId>targeting-engine</artifactId>
21+
<version>${project.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>junit</groupId>
25+
<artifactId>junit</artifactId>
26+
<version>4.13.1</version>
27+
<scope>test</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.mockito</groupId>
31+
<artifactId>mockito-core</artifactId>
32+
<version>5.14.2</version>
33+
<scope>test</scope>
34+
</dependency>
35+
</dependencies>
36+
</project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.split.client.dtos;
2+
3+
/**
4+
* Metadata to support the between matcher.
5+
*
6+
* @author adil
7+
*/
8+
public class BetweenMatcherData {
9+
public DataType dataType;
10+
public long start;
11+
public long end;
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package io.split.client.dtos;
2+
3+
/**
4+
* Metadata to support the between matcher.
5+
*
6+
* @author adil
7+
*/
8+
public class BetweenStringMatcherData {
9+
public String start;
10+
public String end;
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package io.split.client.dtos;
2+
3+
import java.util.List;
4+
5+
/**
6+
* A single condition in the the name. If the condition is fulfilled,
7+
* the partitions are used.
8+
*
9+
* @author adil
10+
*/
11+
public class Condition {
12+
public ConditionType conditionType;
13+
public MatcherGroup matcherGroup;
14+
public List<Partition> partitions;
15+
public String label;
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package io.split.client.dtos;
2+
3+
/**
4+
* Created by adilaijaz on 5/28/15.
5+
*/
6+
public enum ConditionType {
7+
WHITELIST,
8+
ROLLOUT
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package io.split.client.dtos;
2+
3+
/**
4+
* Created by adilaijaz on 5/28/15.
5+
*/
6+
public enum DataType {
7+
NUMBER,
8+
DATETIME,
9+
STRING
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package io.split.client.dtos;
2+
3+
import java.util.List;
4+
5+
public class DependencyMatcherData {
6+
public String split;
7+
public List<String> treatments;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package io.split.client.dtos;
2+
3+
import java.util.List;
4+
5+
public class Excluded {
6+
public List<String> keys;
7+
public List<ExcludedSegments> segments;
8+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package io.split.client.dtos;
2+
3+
public class ExcludedSegments {
4+
public static final String STANDARD_TYPE = "standard";
5+
public static final String RULE_BASED_TYPE = "rule-based";
6+
7+
public ExcludedSegments() {}
8+
public ExcludedSegments(String type, String name) {
9+
this.type = type;
10+
this.name = name;
11+
}
12+
13+
public String type;
14+
public String name;
15+
16+
public boolean isStandard() {
17+
return STANDARD_TYPE.equals(type);
18+
}
19+
20+
public boolean isRuleBased() {
21+
return RULE_BASED_TYPE.equals(type);
22+
}
23+
24+
public String getSegmentName(){
25+
return name;
26+
}
27+
}

0 commit comments

Comments
 (0)