Skip to content

Commit 1407326

Browse files
committed
API and Events domain modules
1 parent 0111c34 commit 1407326

File tree

21 files changed

+270
-2
lines changed

21 files changed

+270
-2
lines changed

api/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# API module
2+
3+
This module contains the public API interfaces and types exposed to consumers of the Split SDK.
4+
5+
Classes in this module are part of the public API contract and should maintain backwards compatibility.
6+

api/build.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
plugins {
2+
id 'com.android.library'
3+
}
4+
5+
apply from: "$rootDir/gradle/common-android-library.gradle"
6+
7+
android {
8+
namespace 'io.split.android.client.api'
9+
10+
compileOptions {
11+
sourceCompatibility JavaVersion.VERSION_1_8
12+
targetCompatibility JavaVersion.VERSION_1_8
13+
}
14+
}
15+
16+
dependencies {
17+
implementation libs.annotation
18+
19+
testImplementation libs.junit4
20+
testImplementation libs.mockitoCore
21+
}
22+

api/consumer-rules.pro

Whitespace-only changes.

api/proguard-rules.pro

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
22+

api/src/androidTest/java/.gitkeep

Whitespace-only changes.

api/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
</manifest>
5+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package io.split.android.client.api;
2+
3+
import androidx.annotation.NonNull;
4+
import androidx.annotation.Nullable;
5+
6+
import java.util.Collection;
7+
import java.util.Map;
8+
import java.util.Set;
9+
10+
/**
11+
* Represents metadata associated with SDK events.
12+
* <p>
13+
* Values are sanitized to only allow String, Number, Boolean, or List&lt;String&gt;.
14+
*/
15+
public interface EventMetadata {
16+
17+
/**
18+
* Returns the set of keys in this metadata.
19+
*
20+
* @return set of keys
21+
*/
22+
@NonNull
23+
Set<String> keys();
24+
25+
/**
26+
* Returns the collection of values in this metadata.
27+
*
28+
* @return collection of values
29+
*/
30+
@NonNull
31+
Collection<Object> values();
32+
33+
/**
34+
* Returns the value associated with the given key.
35+
*
36+
* @param key the key to look up
37+
* @return the value associated with the key, or null if not found
38+
*/
39+
@Nullable
40+
Object get(@NonNull String key);
41+
42+
/**
43+
* Returns whether this metadata contains the given key.
44+
*
45+
* @param key the key to check
46+
* @return true if the key exists, false otherwise
47+
*/
48+
boolean containsKey(@NonNull String key);
49+
50+
/**
51+
* Returns a copy of the underlying data as a Map.
52+
*
53+
* @return a copy of the metadata map
54+
*/
55+
@NonNull
56+
Map<String, Object> toMap();
57+
}
58+

api/src/test/java/io/split/android/client/api/.gitkeep

Whitespace-only changes.

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ dependencies {
141141
include project(':main')
142142
include project(':logger')
143143
include project(':events')
144+
include project(':events-domain')
145+
include project(':api')
144146
}
145147

146148
def splitPOM = {

events-domain/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Events Domain module
2+
3+
This module provides Split-specific events management implementation.
4+
5+
It builds on top of the generic `events` module to provide domain-specific event handling for the Split SDK, including:
6+
- Split-specific event types (SplitEvent, SplitInternalEvent)
7+
- Events manager implementations (SplitEventsManager, EventsManagerCoordinator)
8+
- Event metadata implementation (EventMetadataImpl)
9+

0 commit comments

Comments
 (0)