Skip to content

Commit f827746

Browse files
authored
Merge pull request #63 from DeployGate/feat/add_experimental_annotation
Annotate experimental elements with new annotations
2 parents 19dbe2c + 2e47319 commit f827746

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

sdk/src/main/java/com/deploygate/sdk/CustomLogConfiguration.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package com.deploygate.sdk;
22

33
import com.deploygate.sdk.internal.Logger;
4+
import com.deploygate.sdk.internal.annotations.Experimental;
45

6+
@Experimental
57
public class CustomLogConfiguration {
8+
@Experimental
69
public enum Backpressure {
710
/**
811
* SDK rejects new logs if buffer size is exceeded
@@ -43,6 +46,7 @@ private CustomLogConfiguration(
4346
this.bufferSize = bufferSize;
4447
}
4548

49+
@Experimental
4650
public static class Builder {
4751
private Backpressure backpressure = Backpressure.DROP_BUFFER_BY_OLDEST;
4852
private int bufferSize = DEFAULT_BUFFER_SIZE;

sdk/src/main/java/com/deploygate/sdk/LogcatProcess.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.util.Pair;
55

66
import com.deploygate.sdk.internal.Logger;
7+
import com.deploygate.sdk.internal.annotations.Experimental;
78

89
import java.io.BufferedReader;
910
import java.io.IOException;
@@ -57,7 +58,7 @@ void emit(
5758
* @return a pair of watcher ids (non-nulls). first is the previous watcher id, second is the new watcher id.
5859
*/
5960
Pair<String, String> execute(
60-
String streamSessionKey
61+
@Experimental String streamSessionKey
6162
) {
6263
Pair<String, String> ids;
6364

@@ -125,7 +126,7 @@ static class LogcatWatcher implements Runnable {
125126
private final AtomicInteger state;
126127

127128
LogcatWatcher(
128-
String streamSessionKey,
129+
@Experimental String streamSessionKey,
129130
Callback callback
130131
) {
131132
this.processId = streamSessionKey != null ? streamSessionKey : ClientId.generate();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.deploygate.sdk.internal.annotations;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* Annotate elements that we may change the API until making it stable.
11+
*/
12+
@Documented
13+
@Target({
14+
ElementType.ANNOTATION_TYPE,
15+
ElementType.CONSTRUCTOR,
16+
ElementType.FIELD,
17+
ElementType.METHOD,
18+
ElementType.PARAMETER,
19+
ElementType.TYPE
20+
})
21+
@Retention(RetentionPolicy.CLASS)
22+
public @interface Experimental {}
23+

0 commit comments

Comments
 (0)