|
2 | 2 |
|
3 | 3 | import java.util.Objects; |
4 | 4 |
|
| 5 | +/** A class for storing information about subscriptions */ |
5 | 6 | public class Subscription { |
6 | 7 |
|
| 8 | + /** An identifier for the subscription */ |
7 | 9 | private String subscriptionId; |
| 10 | + /** The name of the stream being subscribed to */ |
8 | 11 | private String streamName; |
| 12 | + /** The offset that indicates the position to start consuming data from the stream */ |
9 | 13 | private SubscriptionOffset subscriptionOffset; |
10 | 14 |
|
| 15 | + /** |
| 16 | + * A constructor for subscriptions |
| 17 | + * |
| 18 | + * @param subscriptionId An identifier for the subscription |
| 19 | + * @param streamName The name of the stream being subscribed to |
| 20 | + * @param subscriptionOffset A {@link SubscriptionOffset} to indicate the position to start |
| 21 | + * consuming data |
| 22 | + */ |
11 | 23 | public Subscription( |
12 | 24 | String subscriptionId, String streamName, SubscriptionOffset subscriptionOffset) { |
13 | 25 | this.subscriptionId = subscriptionId; |
14 | 26 | this.streamName = streamName; |
15 | 27 | this.subscriptionOffset = subscriptionOffset; |
16 | 28 | } |
17 | 29 |
|
| 30 | + /** get the identifier of the subscription */ |
18 | 31 | public String getSubscriptionId() { |
19 | 32 | return subscriptionId; |
20 | 33 | } |
21 | 34 |
|
| 35 | + /** get the name of stream being subscribed to */ |
22 | 36 | public String getStreamName() { |
23 | 37 | return streamName; |
24 | 38 | } |
25 | 39 |
|
| 40 | + /** get the subscription offset */ |
26 | 41 | public SubscriptionOffset getSubscriptionOffset() { |
27 | 42 | return subscriptionOffset; |
28 | 43 | } |
29 | 44 |
|
| 45 | + /** update the identifier of the subscription */ |
30 | 46 | public void setSubscriptionId(String subscriptionId) { |
31 | 47 | this.subscriptionId = subscriptionId; |
32 | 48 | } |
33 | 49 |
|
| 50 | + /** update the name of the stream */ |
34 | 51 | public void setStreamName(String streamName) { |
35 | 52 | this.streamName = streamName; |
36 | 53 | } |
37 | 54 |
|
| 55 | + /** update the subscription offset */ |
38 | 56 | public void setSubscriptionOffset(SubscriptionOffset subscriptionOffset) { |
39 | 57 | this.subscriptionOffset = subscriptionOffset; |
40 | 58 | } |
|
0 commit comments