forked from ringcentral/pubnub-jtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPubSubBuilder.java
More file actions
45 lines (32 loc) · 1.17 KB
/
Copy pathPubSubBuilder.java
File metadata and controls
45 lines (32 loc) · 1.17 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
package com.pubnub.api.builder;
import com.pubnub.api.managers.SubscriptionManager;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
public abstract class PubSubBuilder {
@Getter(AccessLevel.PROTECTED)
@Setter(AccessLevel.PROTECTED)
private List<String> channelSubscriptions;
@Getter(AccessLevel.PROTECTED)
@Setter(AccessLevel.PROTECTED)
private List<String> channelGroupSubscriptions;
@Getter(AccessLevel.PROTECTED)
@Setter(AccessLevel.PROTECTED)
private SubscriptionManager subscriptionManager;
public PubSubBuilder(SubscriptionManager subscriptionManagerInstance) {
this.subscriptionManager = subscriptionManagerInstance;
this.channelSubscriptions = new ArrayList<>();
this.channelGroupSubscriptions = new ArrayList<>();
}
public PubSubBuilder channels(List<String> channel) {
channelSubscriptions.addAll(channel);
return this;
}
public PubSubBuilder channelGroups(List<String> channelGroup) {
channelGroupSubscriptions.addAll(channelGroup);
return this;
}
public abstract void execute();
}